1
0
mirror of https://gitlab.com/openlp/android.git synced 2024-12-22 11:52:49 +00:00

fix layout

This commit is contained in:
Tim Bentley 2016-10-21 20:24:55 +01:00
parent 86c36b1bca
commit 8439408875
8 changed files with 39 additions and 47 deletions

View File

@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
@ -82,8 +74,17 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.0.0/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.0.0/jars" />

View File

@ -112,7 +112,7 @@ public class SearchSelectionDialog extends OpenLPDialog {
String request = JsonHelpers.createRequestJSON("id", text); String request = JsonHelpers.createRequestJSON("id", text);
String url = String.format(Api.SEARCH_PLUGIN_LIVE, plugin.toLowerCase()); String url = String.format(Api.SEARCH_PLUGIN_LIVE, plugin.toLowerCase());
triggerTextRequest(String.format("%s%s", url, request)); triggerTextRequest(String.format("%s%s", url, request));
Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.SEARCH_PLUGIN_LIVE, text)); Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.SEARCH_PLUGIN_LIVE, request));
} catch (JsonHelpers.JSONHandlerException e) { } catch (JsonHelpers.JSONHandlerException e) {
e.printStackTrace(); e.printStackTrace();
Toast.makeText(context, "Request Failed", Toast.LENGTH_SHORT).show(); Toast.makeText(context, "Request Failed", Toast.LENGTH_SHORT).show();

View File

@ -128,6 +128,8 @@ public class LiveListFragment extends OpenLPFragment {
text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
TextView text2 = (TextView) view.findViewById(R.id.liveListNormal); TextView text2 = (TextView) view.findViewById(R.id.liveListNormal);
text2.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); text2.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
Log.i(LOG_TAG, "aaa " + selected +" "+ position);
if (selected == position) { if (selected == position) {
text2.setTypeface(null, Typeface.BOLD_ITALIC); text2.setTypeface(null, Typeface.BOLD_ITALIC);
} else{ } else{

View File

@ -264,7 +264,7 @@ public class SearchFragment extends Fragment {
String it = ""; String it = "";
try { try {
Log.i(LOG_TAG, "list.setOnItemClickListener" + item); Log.i(LOG_TAG, "list.setOnItemClickListener" + item);
it = (String) item.get(0); it = item.get(0).toString();
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -138,10 +138,10 @@ public class ServiceListFragment extends OpenLPFragment {
} }
// Keys used in Hashmap // Keys used in Hashmap
String[] from = {"icon", "title"}; String[] from = {"line","icon", "title"};
// Ids of views in service_list_fragment // Ids of views in service_list_fragment
int[] to = {R.id.icon, R.id.serviceListText}; int[] to = {R.id.servicelistLine, R.id.icon, R.id.serviceListText};
SharedPreferences prefs = context.getSharedPreferences( SharedPreferences prefs = context.getSharedPreferences(
context.getString(R.string.key_shared_preferences), context.getString(R.string.key_shared_preferences),
@ -155,19 +155,27 @@ public class ServiceListFragment extends OpenLPFragment {
// Instantiating an adapter to store each items // Instantiating an adapter to store each items
ListAdapter adapter = new SimpleAdapter(getActivity().getBaseContext(), aList, ListAdapter adapter = new SimpleAdapter(getActivity().getBaseContext(), aList,
R.layout.fragment_service_list, from, to) { R.layout.fragment_service_list, from, to) {
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent); View view = super.getView(position, convertView, parent);
TextView line = (TextView) view.findViewById(R.id.servicelistLine);
TextView text1 = (TextView) view.findViewById(R.id.serviceListText); TextView text1 = (TextView) view.findViewById(R.id.serviceListText);
text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size); text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
Log.i(LOG_TAG, "bbb " + selected +" "+ position);
if (selected == position) { if (selected == position) {
text1.setTextColor(Color.parseColor("#000000")); text1.setTextColor(Color.parseColor("#000000"));
text1.setTypeface(null, Typeface.BOLD_ITALIC); text1.setTypeface(null, Typeface.BOLD_ITALIC);
} else{ } else{
text1.setTypeface(null, Typeface.NORMAL); text1.setTypeface(null, Typeface.NORMAL);
line.setBackgroundColor(0xffffff);
} }
return view; return view;
} }
}; };
setListAdapter(adapter); setListAdapter(adapter);
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);

View File

@ -10,8 +10,8 @@
android:clickable="false" android:clickable="false"
android:longClickable="false" android:longClickable="false"
android:background="@drawable/custom_border"> android:background="@drawable/custom_border">
<View <TextView
android:id="@+id/line" android:id="@+id/liveListLine"
android:layout_width="75sp" android:layout_width="75sp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="14sp"
@ -21,7 +21,7 @@
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:layout_weight="1"/> android:layout_weight="1"/>
<TextView <TextView
android:id="@+id/tag" android:id="@+id/liveListTag"
android:layout_width="75sp" android:layout_width="75sp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:textSize="14sp"
@ -40,15 +40,4 @@
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:textStyle="normal" android:textStyle="normal"
android:layout_weight="1"/> android:layout_weight="1"/>
<TextView
android:id="@+id/liveListSelected"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="14sp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textStyle="bold|italic"
android:layout_weight="1"
android:visibility="gone"/>
</LinearLayout> </LinearLayout>

View File

@ -10,10 +10,22 @@
android:clickable="false" android:clickable="false"
android:longClickable="false" android:longClickable="false"
android:background="@drawable/custom_border"> android:background="@drawable/custom_border">
<TextView
android:id="@+id/servicelistLine"
android:layout_width="4dp"
android:layout_height="36dp"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingEnd="5dp"
android:paddingLeft="5dp"
android:paddingBottom="10dp"
android:background="#4d7bd8"/>
<ImageView <ImageView
android:id="@+id/icon" android:id="@+id/icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="36dp"
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingRight="5dp" android:paddingRight="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.openlp.android2.fragments.ServiceListFragment">
<GridView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="2" />
<TextView
android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" />
</FrameLayout>