1
0
mirror of https://gitlab.com/openlp/android.git synced 2024-12-22 03:42:48 +00:00

Clean up Menu

This commit is contained in:
Tim Bentley 2014-11-29 11:53:54 +00:00
parent 6a3ae407f4
commit 4a5dac56ec
34 changed files with 94 additions and 31 deletions

View File

@ -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 <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction">
@ -97,17 +99,54 @@ public class NavigationDrawerFragment extends Fragment {
selectItem(position);
}
});
mDrawerListView.setAdapter(new ArrayAdapter<String>(
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<HashMap<String, String>> aList = new ArrayList<HashMap<String, String>>();
HashMap<String, String> hm = new HashMap<String, String>();
hm.put("title", getString(R.string.home));
hm.put("icon", Integer.toString(R.drawable.ic_home));
aList.add(hm);
HashMap<String, String> hm1 = new HashMap<String, String>();
hm1.put("title", getString(R.string.service_list));
hm1.put("icon", Integer.toString(R.drawable.ic_inbox));
aList.add(hm1);
HashMap<String, String> hm2 = new HashMap<String, String>();
hm2.put("title", getString(R.string.live_list));
hm2.put("icon", Integer.toString(R.drawable.ic_list));
aList.add(hm2);
HashMap<String, String> hm3 = new HashMap<String, String>();
hm3.put("title", getString(R.string.stage_view));
hm3.put("icon", Integer.toString(R.drawable.ic_local_play));
aList.add(hm3);
HashMap<String, String> hm4 = new HashMap<String, String>();
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<String>(
// 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;
}

View File

@ -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 {

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

View File

@ -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"/>
/>

View File

@ -10,13 +10,35 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:background="#FFFFFF"
android:textStyle="bold"
android:textColor="#000000"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:textSize="14sp"/>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_navigation_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:smoothScrollbar="true"
android:clickable="false"
android:longClickable="false">
<ImageView
android:id="@+id/drawer_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/drawer_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:textColor="#000000"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:textAppearance="?android:attr/textAppearanceLarge"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingLeft="50dp"
android:paddingStart="50dp"
android:paddingEnd="5dp"
android:paddingBottom="10dp"/>
</RelativeLayout>

View File

@ -16,6 +16,8 @@
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingEnd="5dp"
android:paddingLeft="5dp"
android:paddingBottom="10dp"
/>
<TextView
@ -24,9 +26,11 @@
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="#000000"
android:textSize="14dp"
android:textSize="14sp"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:paddingEnd="5dp"
android:paddingBottom="10dp"
/>
</LinearLayout>

View File

@ -1,7 +1,7 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<style name="AppTheme" parent="android:Theme.Light">
<!-- Customize your theme here. -->
</style>