mirror of
https://gitlab.com/openlp/android.git
synced 2024-12-22 03:42:48 +00:00
Search finished
This commit is contained in:
parent
8439408875
commit
a905a94e49
@ -144,7 +144,7 @@ public class OpenLP extends ActionBarActivity
|
||||
.replace(R.id.container_left, ServiceListFragment.newInstance(), "servicelist")
|
||||
.commit();
|
||||
fragmentManager.beginTransaction()
|
||||
.replace(R.id.container_right, LiveListFragment.newInstance())
|
||||
.replace(R.id.container_right, LiveListFragment.newInstance(), "livelist")
|
||||
.commit();
|
||||
mTitle = getString(R.string.live_list);
|
||||
toggerContainer(R.id.next_button, View.VISIBLE);
|
||||
|
@ -18,6 +18,8 @@
|
||||
*******************************************************************************/
|
||||
package org.openlp.android2.common;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONStringer;
|
||||
@ -37,6 +39,7 @@ public class JsonHelpers {
|
||||
responseJSON = new JSONStringer().object().key("request").value(jo)
|
||||
.endObject().toString();
|
||||
responseJSON = URLEncoder.encode(responseJSON, "UTF-8");
|
||||
Log.d(LOG_TAG, String.format("createRequestJSON: %s : %s : %s", key, value, responseJSON));
|
||||
return responseJSON;
|
||||
} catch (JSONException e) {
|
||||
throw new JSONHandlerException(e);
|
||||
|
@ -56,6 +56,8 @@ public class SearchSelectionDialog extends OpenLPDialog {
|
||||
plugin = getArguments().getString("plugin");
|
||||
text = getArguments().getString("text");
|
||||
|
||||
Log.d(LOG_TAG, String.format("onCreateDialog %s : %s : %s", key, plugin, text));
|
||||
|
||||
context = getActivity();
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
@ -121,7 +123,7 @@ public class SearchSelectionDialog extends OpenLPDialog {
|
||||
|
||||
public void createService() {
|
||||
try {
|
||||
String request = JsonHelpers.createRequestJSON("id", key);
|
||||
String request = JsonHelpers.createRequestJSON("id", text);
|
||||
String url = String.format(Api.SEARCH_PLUGIN_ADD, plugin.toLowerCase());
|
||||
triggerTextRequest(String.format("%s%s", url, request));
|
||||
Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.SEARCH_PLUGIN_ADD, text));
|
||||
|
@ -128,10 +128,9 @@ public class LiveListFragment extends OpenLPFragment {
|
||||
text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
|
||||
TextView text2 = (TextView) view.findViewById(R.id.liveListNormal);
|
||||
text2.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
|
||||
Log.i(LOG_TAG, "aaa " + selected +" "+ position);
|
||||
|
||||
if (selected == position) {
|
||||
text2.setTypeface(null, Typeface.BOLD_ITALIC);
|
||||
line.setBackgroundColor(0xffffff);
|
||||
} else{
|
||||
text2.setTypeface(null, Typeface.NORMAL);
|
||||
line.setBackgroundColor(0xffffff);
|
||||
|
@ -163,11 +163,10 @@ public class ServiceListFragment extends OpenLPFragment {
|
||||
TextView line = (TextView) view.findViewById(R.id.servicelistLine);
|
||||
TextView text1 = (TextView) view.findViewById(R.id.serviceListText);
|
||||
text1.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
|
||||
Log.i(LOG_TAG, "bbb " + selected +" "+ position);
|
||||
|
||||
if (selected == position) {
|
||||
text1.setTextColor(Color.parseColor("#000000"));
|
||||
text1.setTypeface(null, Typeface.BOLD_ITALIC);
|
||||
line.setBackgroundColor(0xffffff);
|
||||
} else{
|
||||
text1.setTypeface(null, Typeface.NORMAL);
|
||||
line.setBackgroundColor(0xffffff);
|
||||
|
@ -4,7 +4,7 @@
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
tools:context=".OpenLP">
|
||||
|
||||
<!-- As the main content view, the view below consumes the entire
|
||||
space available using match_parent in both dimensions. -->
|
||||
|
@ -1,12 +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.emptyFragment">
|
||||
|
||||
<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>
|
@ -1,45 +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.LiveListFragment">
|
||||
|
||||
<GridView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:numColumns="2" />
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/fragment_live_list_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:smoothScrollbar="true"
|
||||
android:clickable="false"
|
||||
android:longClickable="false">
|
||||
<TextView
|
||||
android:id="@+id/tag"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:layout_weight="1"/>
|
||||
<TextView
|
||||
android:id="@+id/liveListNormal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ff2a2a2a"
|
||||
android:textSize="14sp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:textStyle="normal"
|
||||
android:layout_weight="1"/>
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
@ -7,6 +7,5 @@
|
||||
For more on layout aliases, see:
|
||||
http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
|
||||
-->
|
||||
<item name="fragment_item" type="layout">@layout/fragment_item_grid</item>
|
||||
|
||||
</resources>
|
@ -7,6 +7,4 @@
|
||||
For more on layout aliases, see:
|
||||
http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
|
||||
-->
|
||||
<item name="fragment_item" type="layout">@layout/fragment_item_grid</item>
|
||||
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user