Added empty text to ListView.
This commit is contained in:
parent
03fa8133ab
commit
3f42575484
4 changed files with 23 additions and 5 deletions
|
@ -58,7 +58,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.app.ListActivity;
|
|||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -12,8 +13,6 @@ import eu.chainfire.libsuperuser.Shell;
|
|||
|
||||
public class MainActivity extends ListActivity {
|
||||
|
||||
private ListView mListView;
|
||||
|
||||
private CertificateAdapter mCertificateAdapter;
|
||||
|
||||
private CertificateManager mCertificateManager;
|
||||
|
@ -31,14 +30,14 @@ public class MainActivity extends ListActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mListView = getListView();
|
||||
setContentView(R.layout.main_activity);
|
||||
mCertificateManager = new CertificateManager();
|
||||
mMovedCertificatesStorage = new MovedCertificatesStorage(this);
|
||||
mCertificateAdapter =
|
||||
new CertificateAdapter(this, mCertificateManager, mMovedCertificatesStorage);
|
||||
mCertificateAdapter.onCertificateChanged();
|
||||
mCertificateManager.setOnCertificateChangedListener(mCertificateAdapter);
|
||||
mListView.setAdapter(mCertificateAdapter);
|
||||
setListAdapter(mCertificateAdapter);
|
||||
|
||||
mMoveCertificatesDialog = new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.dialog_move_certs_title)
|
||||
|
|
18
app/src/main/res/layout/main_activity.xml
Normal file
18
app/src/main/res/layout/main_activity.xml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/empty"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/cert_list_empty"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -15,4 +15,6 @@
|
|||
|
||||
<string name="dialog_no_root_message">This app requires root access to work. Make sure your device is rooted and try again.</string>
|
||||
|
||||
<string name="cert_list_empty">No certificates found. Please install a certificate to use this app.</string>
|
||||
|
||||
</resources>
|
||||
|
|
Reference in a new issue