diff --git a/.gitignore b/.gitignore index 8fbf9407..51f806c9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ gen .DS_Store .settings libs +build diff --git a/Superuser/AndroidManifest.xml b/Superuser/AndroidManifest.xml index fc19edd5..68e52b3f 100644 --- a/Superuser/AndroidManifest.xml +++ b/Superuser/AndroidManifest.xml @@ -1,12 +1,12 @@ + tools:node="replace" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Superuser/build.gradle b/Superuser/build.gradle new file mode 100644 index 00000000..bb868821 --- /dev/null +++ b/Superuser/build.gradle @@ -0,0 +1,51 @@ +task wrapper(type: Wrapper) { + gradleVersion = '1.6' +} + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:0.12.+' + } +} +apply plugin: 'com.android.application' + +repositories { + mavenCentral() +} + +dependencies { + compile project(':Widgets:Widgets') +} + +android { + packagingOptions { + exclude 'META-INF/beans.xml' + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + jniLibs.srcDirs = ['libs'] + assets.srcDirs = ['assets/'] + res.srcDirs = ['res/'] + java.srcDirs = ['src/'] + aidl.srcDirs = ['src/'] + } + } + + compileSdkVersion 21 + buildToolsVersion '20.0.0' + + defaultConfig { + minSdkVersion 14 + targetSdkVersion 21 + } +} + +// upload to maven task +//if (System.getenv().I_AM_KOUSH == 'true') { +// apply from: 'https://raw.github.com/koush/mvn-repo/master/maven.gradle' +//} diff --git a/Superuser/res/layout/empty.xml b/Superuser/res/layout/empty.xml new file mode 100644 index 00000000..8eb5e3fc --- /dev/null +++ b/Superuser/res/layout/empty.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/Superuser/src/com/koushikdutta/superuser/LogFragment.java b/Superuser/src/com/koushikdutta/superuser/LogFragment.java index aa708a62..30de5800 100644 --- a/Superuser/src/com/koushikdutta/superuser/LogFragment.java +++ b/Superuser/src/com/koushikdutta/superuser/LogFragment.java @@ -28,6 +28,7 @@ import android.view.MenuItem; import android.view.MenuItem.OnMenuItemClickListener; import android.view.View; +import android.view.ViewGroup; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.TextView; @@ -125,7 +126,9 @@ protected void onCreate(Bundle savedInstanceState, View view) { logs = SuperuserDatabaseHelper.getLogs(getActivity(), up, -1); } else { - setEmpty(R.string.no_logs); + TextView empty = (TextView)getLayoutInflater(savedInstanceState).inflate(R.layout.empty, null); + ((ViewGroup)view.findViewById(R.id.empty)).addView(empty); + empty.setText(R.string.no_logs); view.findViewById(R.id.policy_header).setVisibility(View.GONE); logs = SuperuserDatabaseHelper.getLogs(getActivity()); } diff --git a/Superuser/src/com/koushikdutta/superuser/PolicyFragment.java b/Superuser/src/com/koushikdutta/superuser/PolicyFragment.java index ee276895..a7698335 100644 --- a/Superuser/src/com/koushikdutta/superuser/PolicyFragment.java +++ b/Superuser/src/com/koushikdutta/superuser/PolicyFragment.java @@ -34,7 +34,9 @@ import android.view.MenuItem; import android.view.MenuItem.OnMenuItemClickListener; import android.view.View; +import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.TextView; import com.koushikdutta.superuser.db.LogEntry; import com.koushikdutta.superuser.db.SuDatabaseHelper; @@ -96,7 +98,9 @@ public void onCreate(Bundle savedInstanceState, View view) { setHasOptionsMenu(true); - setEmpty(R.string.no_apps); + TextView empty = (TextView)getLayoutInflater(savedInstanceState).inflate(R.layout.empty, null); + ((ViewGroup)view.findViewById(R.id.empty)).addView(empty); + empty.setText(R.string.no_apps); load();