Skip to content

Commit

Permalink
gradle and support widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Jul 7, 2014
1 parent 6972532 commit 3a25d68
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ gen
.DS_Store
.settings
libs
build
4 changes: 2 additions & 2 deletions Superuser/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>

This comment has been minimized.

Copy link
@lovesitdoll

lovesitdoll Apr 21, 2016

Permission

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.koushikdutta.superuser"
android:versionCode="1030"
android:versionName="1.0.3.0" >

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
tools:node="replace" />

<permission
android:name="android.permission.REQUEST_SUPERUSER"
Expand Down
64 changes: 64 additions & 0 deletions Superuser/Superuser-Superuser.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="Gradle.Superuser" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":Superuser:Superuser" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugJava" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/res" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-21.0.0-rc1" level="project" />
<orderEntry type="module" module-name="Widgets-Widgets" exported="" />
</component>
</module>

51 changes: 51 additions & 0 deletions Superuser/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
//}
10 changes: 10 additions & 0 deletions Superuser/res/layout/empty.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
style="@android:style/TextAppearance.Large"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
</TextView>
5 changes: 4 additions & 1 deletion Superuser/src/com/koushikdutta/superuser/LogFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand Down
6 changes: 5 additions & 1 deletion Superuser/src/com/koushikdutta/superuser/PolicyFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 3a25d68

Please sign in to comment.