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

search fixes

This commit is contained in:
Tim Bentley 2016-10-19 19:41:22 +01:00
parent 39cb07860d
commit 8efc0e69df
5 changed files with 27 additions and 12 deletions

View File

@ -6,7 +6,7 @@ android {
defaultConfig { defaultConfig {
applicationId "org.openlp.android2" applicationId "org.openlp.android2"
minSdkVersion 15 minSdkVersion 16
targetSdkVersion 22 targetSdkVersion 22
versionCode 5 versionCode 5
versionName "2.0" versionName "2.0"

View File

@ -77,7 +77,6 @@ public class SearchFragment extends Fragment {
protected String updateUrl; protected String updateUrl;
protected String searchedPlugin; protected String searchedPlugin;
protected Map<String, String> pluginMap = new HashMap<String, String>(); protected Map<String, String> pluginMap = new HashMap<String, String>();
protected ArrayList<JSONArray> jsonCache = new ArrayList<JSONArray>();
public SearchFragment() { public SearchFragment() {
Log.d(LOG_TAG, "Constructor"); Log.d(LOG_TAG, "Constructor");
@ -248,11 +247,10 @@ public class SearchFragment extends Fragment {
} }
} }
jsonCache = new ArrayList<JSONArray>();
final StableArrayAdapter adapter = new StableArrayAdapter(context, final StableArrayAdapter adapter = new StableArrayAdapter(context,
android.R.layout.simple_list_item_1, android.R.layout.simple_list_item_1,
listitems, listitems);
jsonCache);
list.setAdapter(adapter); list.setAdapter(adapter);
list.setOnItemClickListener(new AdapterView.OnItemClickListener() { list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@ -273,9 +271,9 @@ public class SearchFragment extends Fragment {
args.putString("plugin", searchedPlugin); args.putString("plugin", searchedPlugin);
args.putString("text", it); args.putString("text", it);
args.putString("key", Long.toString(id)); args.putString("key", Long.toString(id));
DialogFragment newFragment = new SearchSelectionDialog(); DialogFragment SSDFragment = new SearchSelectionDialog();
newFragment.setArguments(args); SSDFragment.setArguments(args);
newFragment.show(getFragmentManager(), "TAG"); SSDFragment.show(getFragmentManager(), "TAG");
} }
}); });
@ -285,12 +283,13 @@ public class SearchFragment extends Fragment {
private class StableArrayAdapter extends ArrayAdapter<JSONArray> { private class StableArrayAdapter extends ArrayAdapter<JSONArray> {
HashMap<String, Integer> mIdMap = new HashMap<String, Integer>(); HashMap<String, Integer> mIdMap = new HashMap<String, Integer>();
ArrayList<JSONArray> jsonCache = new ArrayList<JSONArray>();
public StableArrayAdapter(Context context, public StableArrayAdapter(Context context,
int textViewResourceId, int textViewResourceId,
List<JSONArray> objects, List<JSONArray> objects) {
ArrayList<JSONArray> jsonCache) {
super(context, textViewResourceId, objects); super(context, textViewResourceId, objects);
jsonCache = new ArrayList<JSONArray>();
for (int i = 0; i < objects.size(); ++i) { for (int i = 0; i < objects.size(); ++i) {
JSONArray item = objects.get(i); JSONArray item = objects.get(i);
@ -310,6 +309,7 @@ public class SearchFragment extends Fragment {
String item = null; String item = null;
try { try {
item = getItem(position).get(1).toString(); item = getItem(position).get(1).toString();
Log.i(LOG_TAG, "getView" + item);
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -331,6 +331,7 @@ public class SearchFragment extends Fragment {
String item = null; String item = null;
try { try {
item = getItem(position).get(1).toString(); item = getItem(position).get(1).toString();
Log.i(LOG_TAG, "getItemId" + item);
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="90"
android:toDegrees="90">
<shape
android:shape="line"
android:left="1dp">
<stroke
android:width="2dp"
android:color="#0008ff"
android:dashWidth="1dp"
android:dashGap="2dp" />
</shape>
</rotate>

View File

@ -24,7 +24,7 @@
android:id="@+id/serviceListText" android:id="@+id/serviceListText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="normal"
android:textColor="#000000" android:textColor="#000000"
android:textSize="14sp" android:textSize="14sp"
android:paddingTop="10dp" android:paddingTop="10dp"

View File

@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.android.tools.build:gradle:2.2.1'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files