Fix icons and service list
@ -44,6 +44,7 @@ abstract public class OpenLPFragment extends ListFragment{
|
|||||||
public Context context;
|
public Context context;
|
||||||
protected String calledURL;
|
protected String calledURL;
|
||||||
protected OpenLPHttpClient httpClient;
|
protected OpenLPHttpClient httpClient;
|
||||||
|
protected String updateUrl;
|
||||||
|
|
||||||
abstract public void itemClicked(int position);
|
abstract public void itemClicked(int position);
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ abstract public class OpenLPFragment extends ListFragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void manageResponse(String response) {
|
public void manageResponse(String response) {
|
||||||
if (calledURL.equals(Api.POLL_STATUS)) {
|
if (calledURL.equals(updateUrl)) {
|
||||||
populateDisplay(response);
|
populateDisplay(response);
|
||||||
}else {
|
}else {
|
||||||
processUpdate(response);
|
processUpdate(response);
|
||||||
|
@ -38,6 +38,7 @@ import org.openlp.android2.R;
|
|||||||
import org.openlp.android2.api.Api;
|
import org.openlp.android2.api.Api;
|
||||||
import org.openlp.android2.common.JsonHelpers;
|
import org.openlp.android2.common.JsonHelpers;
|
||||||
import org.openlp.android2.common.OpenLPFragment;
|
import org.openlp.android2.common.OpenLPFragment;
|
||||||
|
import org.openlp.android2.common.OpenLPHttpClient;
|
||||||
import org.openlp.android2.fragments.dummy.DummyContent;
|
import org.openlp.android2.fragments.dummy.DummyContent;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -84,6 +85,8 @@ public class ServiceListFragment extends OpenLPFragment {
|
|||||||
context = getActivity();
|
context = getActivity();
|
||||||
noScreenUpdate = false;
|
noScreenUpdate = false;
|
||||||
isDoubleClick = false;
|
isDoubleClick = false;
|
||||||
|
updateUrl = Api.SERVICE_LIST;
|
||||||
|
httpClient = new OpenLPHttpClient(context);
|
||||||
return super.onCreateView(inflater, container, savedInstanceState);
|
return super.onCreateView(inflater, container, savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,6 +127,9 @@ public class ServiceListFragment extends OpenLPFragment {
|
|||||||
triggerTextRequest(Api.SERVICE_LIST);
|
triggerTextRequest(Api.SERVICE_LIST);
|
||||||
Log.d(LOG_TAG, "Resumed...");
|
Log.d(LOG_TAG, "Resumed...");
|
||||||
}
|
}
|
||||||
|
public void processUpdate(String response) {
|
||||||
|
triggerTextRequest(Api.SERVICE_LIST);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void populateDisplay(String json) {
|
public void populateDisplay(String json) {
|
||||||
@ -144,7 +150,7 @@ public class ServiceListFragment extends OpenLPFragment {
|
|||||||
if (item.getString("plugin").equals("songs")) {
|
if (item.getString("plugin").equals("songs")) {
|
||||||
hm.put("icon", Integer.toString(R.drawable.ic_my_library_music));
|
hm.put("icon", Integer.toString(R.drawable.ic_my_library_music));
|
||||||
} else if (item.getString("plugin").equals("bibles")) {
|
} else if (item.getString("plugin").equals("bibles")) {
|
||||||
hm.put("icon", Integer.toString(R.drawable.ic_my_library_add));
|
hm.put("icon", Integer.toString(R.drawable.ic_my_library_books));
|
||||||
} else if (item.getString("plugin").equals("media")) {
|
} else if (item.getString("plugin").equals("media")) {
|
||||||
hm.put("icon", Integer.toString(R.drawable.ic_local_movies));
|
hm.put("icon", Integer.toString(R.drawable.ic_local_movies));
|
||||||
} else if (item.getString("plugin").equals("presentations")) {
|
} else if (item.getString("plugin").equals("presentations")) {
|
||||||
@ -215,12 +221,11 @@ public class ServiceListFragment extends OpenLPFragment {
|
|||||||
String message = String.format("Setting list data. apiBase(%s), position(%s)",
|
String message = String.format("Setting list data. apiBase(%s), position(%s)",
|
||||||
Api.SERVICE_SET, position);
|
Api.SERVICE_SET, position);
|
||||||
Log.d(LOG_TAG, message);
|
Log.d(LOG_TAG, message);
|
||||||
Toast.makeText(getActivity().getBaseContext(), "Service Item selected", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Service Item selected", Toast.LENGTH_SHORT).show();
|
||||||
} catch (JsonHelpers.JSONHandlerException e) {
|
} catch (JsonHelpers.JSONHandlerException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Toast.makeText(getActivity().getBaseContext(), "Request Failed", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "Request Failed", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
triggerTextRequest(Api.SERVICE_LIST);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 339 B After Width: | Height: | Size: 294 B |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 337 B |
BIN
app/src/main/res/drawable-hdpi/ic_launcher.png
Normal file → Executable file
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 287 B |
BIN
app/src/main/res/drawable-hdpi/ic_my_library_books.png
Normal file
After Width: | Height: | Size: 276 B |
Before Width: | Height: | Size: 330 B After Width: | Height: | Size: 324 B |
BIN
app/src/main/res/drawable-hdpi/openlp_splash_screen.png
Normal file
After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 315 B |
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 287 B |
BIN
app/src/main/res/drawable-mdpi/ic_launcher.png
Normal file → Executable file
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 236 B |
Before Width: | Height: | Size: 329 B |
BIN
app/src/main/res/drawable-mdpi/ic_my_library_books.png
Normal file
After Width: | Height: | Size: 312 B |
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 382 B |
Before Width: | Height: | Size: 415 B After Width: | Height: | Size: 337 B |
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 470 B |
BIN
app/src/main/res/drawable-xhdpi/ic_launcher.png
Normal file → Executable file
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 259 B After Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 351 B |
BIN
app/src/main/res/drawable-xhdpi/ic_my_library_books.png
Normal file
After Width: | Height: | Size: 339 B |
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 429 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_dvr.png
Normal file
After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 490 B After Width: | Height: | Size: 366 B |
Before Width: | Height: | Size: 614 B After Width: | Height: | Size: 568 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_launcher.png
Normal file → Executable file
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 237 B |
Before Width: | Height: | Size: 432 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_my_library_books.png
Normal file
After Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 562 B |
@ -22,7 +22,7 @@
|
|||||||
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="bold"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#000000"
|
||||||
android:textSize="14dp"
|
android:textSize="14dp"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
|