1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 17:59:33 +02:00

code simplification

This commit is contained in:
Nikolay Pultsin 2013-09-16 03:03:58 +04:00
parent a377ec8bf7
commit 7b32f9e8bd
2 changed files with 3 additions and 19 deletions

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<ListView
android:id="@+id/selectedList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>

View file

@ -21,7 +21,7 @@ package org.geometerplus.android.fbreader.network;
import java.util.*; import java.util.*;
import android.app.Activity; import android.app.ListActivity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
@ -32,7 +32,7 @@ import org.geometerplus.zlibrary.ui.android.R;
import org.geometerplus.fbreader.network.*; import org.geometerplus.fbreader.network.*;
import org.geometerplus.android.fbreader.covers.CoverManager; import org.geometerplus.android.fbreader.covers.CoverManager;
public class AllCatalogsActivity extends Activity { public class AllCatalogsActivity extends ListActivity {
final NetworkLibrary myLibrary = NetworkLibrary.Instance(); final NetworkLibrary myLibrary = NetworkLibrary.Instance();
private ArrayList<Item> myAllItems = new ArrayList<Item>(); private ArrayList<Item> myAllItems = new ArrayList<Item>();
ArrayList<String> myIds = new ArrayList<String>(); ArrayList<String> myIds = new ArrayList<String>();
@ -47,8 +47,6 @@ public class AllCatalogsActivity extends Activity {
protected void onCreate(Bundle icicle) { protected void onCreate(Bundle icicle) {
super.onCreate(icicle); super.onCreate(icicle);
setContentView(R.layout.network_library_filter);
Intent intent = getIntent(); Intent intent = getIntent();
myIds = intent.getStringArrayListExtra(IDS_LIST); myIds = intent.getStringArrayListExtra(IDS_LIST);
myInactiveIds = intent.getStringArrayListExtra(INACTIVE_IDS_LIST); myInactiveIds = intent.getStringArrayListExtra(INACTIVE_IDS_LIST);
@ -78,8 +76,7 @@ public class AllCatalogsActivity extends Activity {
myAllItems.addAll(cItems); myAllItems.addAll(cItems);
} }
final ListView selectedList = (ListView)findViewById(R.id.selectedList); setListAdapter(new CatalogsListAdapter());
selectedList.setAdapter(new CatalogsListAdapter());
} }
@Override @Override