Permalink
Browse files

add categories and offline manifest

  • Loading branch information...
1 parent 7ce8923 commit b82c41b6e125cacb1c11256d6851ebba8c036164 @romanbb committed Aug 16, 2012
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wallpapers>
+
+ <!--
+ Categories accept:
+ id="<string>" unique id string
+ name="<string>" visual name
+
+ Wallpapers accept:
+ url="<url of wallpaper>"
+ thumbUrl="<url of thumbnail>"
+ author="<author>" may be used for filtering later
+ date="<date added>" may be used for filtering later
+ name="<wallpaper name">
+ -->
+
+ <category name="AOKP" >
+
+ <wallpaper
+ author="ThaPHLASH"
+ url="http://aokp.co/wallpapers/thaplash_logo_head_office.jpg" />
+
+ <wallpaper
+ author="ThaPHLASH"
+ url="http://aokp.co/wallpapers/thaplash_logo_head_office2.jpg" />
+
+ <wallpaper
+ author="eatmode4life"
+ url="http://aokp.co/wallpapers/eatmode4life_skycore.jpg" />
+
+ <wallpaper
+ author="JaiThemes"
+ url="http://aokp.co/wallpapers/jaithemes_striped_blue.jpg" />
+
+ <wallpaper
+ author="JaiThemes"
+ url="http://aokp.co/wallpapers/jaithemes_striped.jpg" />
+
+ <wallpaper
+ author="JaiThemes"
+ url="http://aokp.co/wallpapers/jaithemes_village_gradient.jpg" />
+
+ <wallpaper
+ author="Just_Reboot"
+ url="http://aokp.co/wallpapers/just_reboot_abstract.png" />
+
+ <wallpaper
+ author="Just_Reboot"
+ url="http://aokp.co/wallpapers/just_reboot_abstract2.png" />
+
+ <wallpaper
+ author="Just_Reboot"
+ url="http://aokp.co/wallpapers/just_reboot_aokp_samurai.png" />
+
+ <wallpaper
+ author="Just_Reboot"
+ url="http://aokp.co/wallpapers/just_reboot_wall_10.png" />
+
+ <wallpaper
+ author="KnokFirst"
+ url="http://aokp.co/wallpapers/knokfirst_phlashlogo_crazy.jpg" />
+
+ <wallpaper
+ author="KnokFirst"
+ url="http://aokp.co/wallpapers/knokfirst_phlashlogo_light.jpg" />
+
+ <wallpaper
+ author="Just_Reboot"
+ url="http://aokp.co/wallpapers/knokfirst_phlashlogo.jpg" />
+
+ <wallpaper
+ author="kwes1020"
+ url="http://aokp.co/wallpapers/kwes1020_aokpwp1.png" />
+
+ <wallpaper
+ author="kwes1020"
+ url="http://aokp.co/wallpapers/kwes1020_aokpwp2.png" />
+ </category>
+
+ <category name="Older Wallpapers" >
+
+ <wallpaper
+ author="Bluewall"
+ url="http://aokp.co/wallpapers/bluewall_white_unicorn_and_blue.jpg" />
+
+ <wallpaper
+ author="Bluewall"
+ url="http://aokp.co/wallpapers/bluewall_white_unicorn_and_green.jpg" />
+
+ <wallpaper
+ author="Bluewall"
+ url="http://aokp.co/wallpapers/bluewall_white_unicorn_and_orange.jpg" />
+
+ <wallpaper
+ author="JaiThemes"
+ url="http://aokp.co/wallpapers/jaithemes_setyourunicornfree.jpg" />
+
+ <wallpaper
+ author="Mobile_Sensei"
+ url="http://aokp.co/wallpapers/mobile_sensei_x1.jpg" />
+
+ <wallpaper
+ author="Mobile_Sensei"
+ url="http://aokp.co/wallpapers/mobile_sensei_x2.jpg" />
+
+ <wallpaper
+ author="Mobile_Sensei"
+ url="http://aokp.co/wallpapers/mobile_sensei_x3.jpg" />
+
+ <wallpaper
+ author="Mobile_Sensei"
+ url="http://aokp.co/wallpapers/mobile_sensei_x4.jpg" />
+
+ <wallpaper
+ author="Mobile_Sensei"
+ url="http://aokp.co/wallpapers/mobile_sensei_x5.jpg" />
+
+ <wallpaper
+ author="Mobile_Sensei"
+ url="http://aokp.co/wallpapers/mobile_sensei_x6.jpg" />
+
+ <wallpaper
+ author="Mobile_Sensei"
+ url="http://aokp.co/wallpapers/mobile_sensi_star.jpg" />
+
+ <wallpaper
+ author="SamsungClay"
+ url="http://aokp.co/wallpapers/samsungclay02.jpg" />
+ </category>
+
+</wallpapers>
@@ -69,4 +69,13 @@
android:layout_centerVertical="true"
android:src="@drawable/ic_placeholder" />
+ <ProgressBar
+ android:id="@+id/progress_bar"
+ style="?android:attr/progressBarStyleLarge"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:visibility="gone" />
+
</RelativeLayout>
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="40dp"
+ android:orientation="vertical"
+ android:paddingLeft="@dimen/padding_small"
+ android:paddingRight="@dimen/padding_small" >
+
+ <TextView
+ android:id="@+id/category"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_gravity="fill_vertical"
+ android:layout_weight="1"
+ android:gravity="center_vertical|left"
+ android:text="Category Name"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/category_description"
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:text="Choose category"
+ android:textColor="#FF999999" />
+
+</LinearLayout>
@@ -14,7 +14,8 @@
android:layout_width="wrap_content"
android:layout_height="42dip"
android:layout_alignParentTop="true"
- android:gravity="center_vertical" >
+ android:gravity="center_vertical"
+ android:orientation="vertical" >
<TextView
android:id="@+id/name"
@@ -36,6 +37,7 @@
android:singleLine="true"
android:text="author"
android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textSize="12dp"
android:textColor="@android:color/white" />
</LinearLayout>
@@ -0,0 +1,100 @@
+
+package com.aokp.swagpapers;
+
+import android.content.Context;
+import android.database.DataSetObserver;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.SpinnerAdapter;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+public class NavigationBarCategoryAdapater implements SpinnerAdapter {
+
+ Context mContext;
+ ArrayList<WallpaperCategory> mCategories;
+
+ public NavigationBarCategoryAdapater(Context c, ArrayList<WallpaperCategory> cats) {
+ mContext = c;
+ WallpaperCategory allCats = new WallpaperCategory(cats.size() + "", "<All>");
+ for (WallpaperCategory cat : cats) {
+ for (Wallpaper wall : cat.getWallpapers()) {
+ allCats.addWallpaper(wall);
+ }
+ }
+ cats.add(0, allCats);
+
+ mCategories = cats;
+ }
+
+ @Override
+ public int getCount() {
+ return mCategories.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return mCategories.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ return 0;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View v = LayoutInflater.from(mContext).inflate(
+ R.layout.navigation_bar_category_spinner, parent, false);
+ TextView catTitle = (TextView) v.findViewById(R.id.category);
+ catTitle.setText(mCategories.get(position).getName());
+
+ return v;
+ }
+
+ @Override
+ public int getViewTypeCount() {
+ return 1;
+ }
+
+ @Override
+ public boolean hasStableIds() {
+ return true;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return mCategories.isEmpty();
+ }
+
+ @Override
+ public void registerDataSetObserver(DataSetObserver observer) {
+
+ }
+
+ @Override
+ public void unregisterDataSetObserver(DataSetObserver observer) {
+
+ }
+
+ @Override
+ public View getDropDownView(int position, View convertView, ViewGroup parent) {
+ View v = LayoutInflater.from(mContext).inflate(
+ R.layout.navigation_bar_category_spinner, parent, false);
+ TextView catTitle = (TextView) v.findViewById(R.id.category);
+ catTitle.setText(mCategories.get(position).getName());
+
+ TextView desc = (TextView) v.findViewById(R.id.category_description);
+ desc.setVisibility(View.GONE);
+
+ return v;
+ }
+
+}
Oops, something went wrong.

0 comments on commit b82c41b

Please sign in to comment.