diff --git a/app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java b/app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java index 0b1839b..d756e8b 100644 --- a/app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/NavigationDrawerFragment.java @@ -4,7 +4,6 @@ package org.openlp.android2.fragments; import android.app.Activity; import android.app.ActionBar; import android.app.Fragment; -import android.content.res.Resources; import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; @@ -12,7 +11,6 @@ import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceManager; -import android.util.TypedValue; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -22,6 +20,10 @@ import android.view.ViewGroup; import android.widget.*; import org.openlp.android2.R; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + /** * Fragment used for managing interactions for and presentation of a navigation drawer. * See the @@ -97,17 +99,54 @@ public class NavigationDrawerFragment extends Fragment { selectItem(position); } }); - mDrawerListView.setAdapter(new ArrayAdapter( - getActionBar().getThemedContext(), - R.layout.fragment_navigation_drawer_list, - android.R.id.text1, - new String[]{ - getString(R.string.home), - getString(R.string.service_list), - getString(R.string.live_list), - getString(R.string.stage_view), - getString(R.string.live_view), - })); + + List> aList = new ArrayList>(); + HashMap hm = new HashMap(); + hm.put("title", getString(R.string.home)); + hm.put("icon", Integer.toString(R.drawable.ic_home)); + aList.add(hm); + + HashMap hm1 = new HashMap(); + hm1.put("title", getString(R.string.service_list)); + hm1.put("icon", Integer.toString(R.drawable.ic_inbox)); + aList.add(hm1); + + HashMap hm2 = new HashMap(); + hm2.put("title", getString(R.string.live_list)); + hm2.put("icon", Integer.toString(R.drawable.ic_list)); + aList.add(hm2); + + HashMap hm3 = new HashMap(); + hm3.put("title", getString(R.string.stage_view)); + hm3.put("icon", Integer.toString(R.drawable.ic_local_play)); + aList.add(hm3); + + HashMap hm4 = new HashMap(); + hm4.put("title", getString(R.string.live_view)); + hm4.put("icon", Integer.toString(R.drawable.ic_desktop_windows)); + aList.add(hm4); + + // Keys used in Hashmap + String[] from = {"icon", "title"}; + + // Ids of views in service_list_fragment + int[] to = {R.id.drawer_icon, R.id.drawer_text}; + + ListAdapter adapter = new SimpleAdapter(getActivity().getBaseContext(), aList, + R.layout.fragment_navigation_drawer_list, from, to); + + mDrawerListView.setAdapter(adapter); +// new ArrayAdapter( +// getActionBar().getThemedContext(), +// R.layout.fragment_navigation_drawer_list, +// R.id.drawer_text, +// new String[]{ +// getString(R.string.home), +// getString(R.string.service_list), +// getString(R.string.live_list), +// getString(R.string.stage_view), +// getString(R.string.live_view), +// })); mDrawerListView.setItemChecked(mCurrentSelectedPosition, true); return mDrawerListView; } diff --git a/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java b/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java index 7524780..28137d0 100644 --- a/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java +++ b/app/src/main/java/org/openlp/android2/fragments/ServiceListFragment.java @@ -143,7 +143,7 @@ public class ServiceListFragment extends OpenLPFragment { } else if (item.getString("plugin").equals("media")) { hm.put("icon", Integer.toString(R.drawable.ic_local_movies)); } else if (item.getString("plugin").equals("presentations")) { - hm.put("icon", Integer.toString(R.drawable.ic_dvr)); + hm.put("icon", Integer.toString(R.drawable.ic_video_collection)); } else if (item.getString("plugin").equals("images")) { hm.put("icon", Integer.toString(R.drawable.ic_image)); } else { diff --git a/app/src/main/res/drawable-hdpi/ic_desktop_windows.png b/app/src/main/res/drawable-hdpi/ic_desktop_windows.png new file mode 100644 index 0000000..0e8d333 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_desktop_windows.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_dvr.png b/app/src/main/res/drawable-hdpi/ic_dvr.png deleted file mode 100644 index 6c034ce..0000000 Binary files a/app/src/main/res/drawable-hdpi/ic_dvr.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_home.png b/app/src/main/res/drawable-hdpi/ic_home.png new file mode 100644 index 0000000..d24c0d0 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_home.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_inbox.png b/app/src/main/res/drawable-hdpi/ic_inbox.png new file mode 100644 index 0000000..04c486d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_inbox.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_list.png b/app/src/main/res/drawable-hdpi/ic_list.png new file mode 100644 index 0000000..ceaf368 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_list.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_local_play.png b/app/src/main/res/drawable-hdpi/ic_local_play.png new file mode 100644 index 0000000..98dd4ef Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_local_play.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_video_collection.png b/app/src/main/res/drawable-hdpi/ic_video_collection.png new file mode 100644 index 0000000..10fa774 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_video_collection.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_desktop_windows.png b/app/src/main/res/drawable-mdpi/ic_desktop_windows.png new file mode 100644 index 0000000..21fdcf9 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_desktop_windows.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_dvr.png b/app/src/main/res/drawable-mdpi/ic_dvr.png deleted file mode 100644 index 97d697c..0000000 Binary files a/app/src/main/res/drawable-mdpi/ic_dvr.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_home.png b/app/src/main/res/drawable-mdpi/ic_home.png new file mode 100644 index 0000000..84815f6 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_home.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_inbox.png b/app/src/main/res/drawable-mdpi/ic_inbox.png new file mode 100644 index 0000000..f35395c Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_inbox.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_list.png b/app/src/main/res/drawable-mdpi/ic_list.png new file mode 100644 index 0000000..b830f19 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_list.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_local.png b/app/src/main/res/drawable-mdpi/ic_local.png new file mode 100644 index 0000000..2b3482f Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_local.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_video_collection.png b/app/src/main/res/drawable-mdpi/ic_video_collection.png new file mode 100644 index 0000000..1bf7399 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_video_collection.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_desktop_windows.png b/app/src/main/res/drawable-xhdpi/ic_desktop_windows.png new file mode 100644 index 0000000..518a0fa Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_desktop_windows.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_dvr.png b/app/src/main/res/drawable-xhdpi/ic_dvr.png deleted file mode 100644 index a513eb9..0000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_dvr.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_home.png b/app/src/main/res/drawable-xhdpi/ic_home.png new file mode 100644 index 0000000..645b3d9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_home.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_inbox.png b/app/src/main/res/drawable-xhdpi/ic_inbox.png new file mode 100644 index 0000000..3c8dce6 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_inbox.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_list.png b/app/src/main/res/drawable-xhdpi/ic_list.png new file mode 100644 index 0000000..ceaf368 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_list.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_local_play.png b/app/src/main/res/drawable-xhdpi/ic_local_play.png new file mode 100644 index 0000000..c8bdca9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_local_play.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_video_collection.png b/app/src/main/res/drawable-xhdpi/ic_video_collection.png new file mode 100644 index 0000000..8635303 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_video_collection.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_desktop_windows.png b/app/src/main/res/drawable-xxhdpi/ic_desktop_windows.png new file mode 100644 index 0000000..518a0fa Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_desktop_windows.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_dvr.png b/app/src/main/res/drawable-xxhdpi/ic_dvr.png deleted file mode 100644 index b2d0a0f..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_dvr.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_home.png b/app/src/main/res/drawable-xxhdpi/ic_home.png new file mode 100644 index 0000000..56c6cb7 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_home.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_inbox.png b/app/src/main/res/drawable-xxhdpi/ic_inbox.png new file mode 100644 index 0000000..6ebded2 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_inbox.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_list.png b/app/src/main/res/drawable-xxhdpi/ic_list.png new file mode 100644 index 0000000..7781225 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_list.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_local_play.png b/app/src/main/res/drawable-xxhdpi/ic_local_play.png new file mode 100644 index 0000000..98dd4ef Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_local_play.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_video_collection.png b/app/src/main/res/drawable-xxhdpi/ic_video_collection.png new file mode 100644 index 0000000..e63c808 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_video_collection.png differ diff --git a/app/src/main/res/layout/fragment_navigation_drawer.xml b/app/src/main/res/layout/fragment_navigation_drawer.xml index c1b86f3..96a35e9 100644 --- a/app/src/main/res/layout/fragment_navigation_drawer.xml +++ b/app/src/main/res/layout/fragment_navigation_drawer.xml @@ -5,10 +5,8 @@ android:choiceMode="singleChoice" android:divider="@android:color/darker_gray" android:dividerHeight="2dp" - android:textStyle="bold" - android:textColor="#000000" - android:textAppearance="?android:attr/textAppearanceSmallInverse" + android:background="#DADADC" + android:textAppearance="?android:attr/textAppearanceLarge" tools:context=".NavigationDrawerFragment" android:drawSelectorOnTop="false" - android:paddingLeft="20dp" - android:paddingStart="20dp"/> + /> diff --git a/app/src/main/res/layout/fragment_navigation_drawer_list.xml b/app/src/main/res/layout/fragment_navigation_drawer_list.xml index ea74633..d76f873 100644 --- a/app/src/main/res/layout/fragment_navigation_drawer_list.xml +++ b/app/src/main/res/layout/fragment_navigation_drawer_list.xml @@ -10,13 +10,35 @@ See the License for the specific language governing permissions and limitations under the License. --> - \ No newline at end of file + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_service_list.xml b/app/src/main/res/layout/fragment_service_list.xml index 3a4eaf4..9718fa5 100644 --- a/app/src/main/res/layout/fragment_service_list.xml +++ b/app/src/main/res/layout/fragment_service_list.xml @@ -16,6 +16,8 @@ android:layout_height="wrap_content" android:paddingTop="10dp" android:paddingRight="5dp" + android:paddingEnd="5dp" + android:paddingLeft="5dp" android:paddingBottom="10dp" /> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ff6c9d2..e84bc5e 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ -