Skip to content

Commit

Permalink
Use AppCompat, minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DSteve595 committed Jul 1, 2015
1 parent d38396f commit 5fe9d66
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 80 deletions.
4 changes: 2 additions & 2 deletions Emoji Switcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 22
versionCode 9
versionName "1.6.1"
versionCode 10
versionName "1.6.2"
}

compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import android.os.Build;
import android.widget.Toast;

import com.stericson.RootShell.exceptions.RootDeniedException;
import com.stericson.RootShell.execution.Command;
import com.stericson.RootShell.execution.Shell;
import com.stericson.RootTools.RootTools;
import com.stericson.RootTools.exceptions.RootDeniedException;
import com.stericson.RootTools.execution.CommandCapture;
import com.stericson.RootTools.execution.Shell;

import org.apache.commons.io.FileUtils;

Expand Down Expand Up @@ -81,7 +81,7 @@ public static void applyPermissions(final Activity activity, String permissions,
try {
RootTools.remount(path, "RW");
Shell shell = RootTools.getShell(true);
CommandCapture commandPermission = new CommandCapture(0, "chmod " + permissions + " " + path);
Command commandPermission = new Command(0, "chmod " + permissions + " " + path);
shell.add(commandPermission);
shell.close();
} catch (TimeoutException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -33,7 +34,7 @@
import java.util.ArrayList;
import java.util.List;

public class SwitcherActivity extends Activity {
public class SwitcherActivity extends AppCompatActivity {

private TextView textCurrentEmojiSet;
private ImageButton buttonRefreshEmojiState;
Expand Down Expand Up @@ -79,7 +80,7 @@ public void onClick(View v) {
emojiSetsAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerInstallEmojis.setAdapter(emojiSetsAdapter);

final Button buttonReboot = (Button) findViewById(R.id.button_reboot);
Button buttonReboot = (Button) findViewById(R.id.button_reboot);
buttonReboot.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand All @@ -93,7 +94,7 @@ public void onClick(View v) {
public void onClick(View v) {
emojiSwitcherUtils.installEmojiSet(SwitcherActivity.this, (EmojiSet) spinnerInstallEmojis.getSelectedItem());
refreshCurrentSystemEmojiSet();
emojiSwitcherUtils.makeRebootDialog(SwitcherActivity.this).show();
EmojiSwitcherUtils.makeRebootDialog(SwitcherActivity.this).show();
}
});

Expand Down Expand Up @@ -233,7 +234,7 @@ public void onIabSetupFinished(IabResult result) {
}

private void checkAds() {
List additionalSkuList = new ArrayList();
List<String> additionalSkuList = new ArrayList<>();
additionalSkuList.add(EmojiSwitcherUtils.SKU_REMOVEADS);
billingHelper.queryInventoryAsync(true, additionalSkuList,
new IabHelper.QueryInventoryFinishedListener() {
Expand Down
35 changes: 0 additions & 35 deletions Emoji Switcher/src/main/res/drawable/button.xml

This file was deleted.

4 changes: 2 additions & 2 deletions Emoji Switcher/src/main/res/drawable/button_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</item>
<item android:state_enabled="true">
<shape android:shape="oval">
<solid android:color="@color/button_normal" />
<solid android:color="@color/emojiswitcher_orange_faded2" />
</shape>
</item>
<item android:state_focused="true">
Expand All @@ -28,7 +28,7 @@
</item>
<item>
<shape android:shape="oval">
<solid android:color="@color/button_normal" />
<solid android:color="@color/emojiswitcher_orange_faded2" />
</shape>
</item>

Expand Down
8 changes: 5 additions & 3 deletions Emoji Switcher/src/main/res/layout/activity_emojiswitcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@

<ImageButton
android:id="@+id/button_refreshemojistate"
style="@style/EmojiSwitcher.Button.Round"
style="@style/EmojiSwitcher.ButtonRound"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/refresh"
android:scaleType="fitCenter"
android:src="@drawable/ic_refresh"
android:text="@string/refresh" />
android:src="@drawable/ic_refresh" />

<LinearLayout
android:layout_width="wrap_content"
Expand Down Expand Up @@ -112,6 +112,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingBottom="8dp"
android:paddingTop="4dp"
android:spinnerMode="dropdown" />

<Button
Expand Down
16 changes: 0 additions & 16 deletions Emoji Switcher/src/main/res/values-v21/styles.xml

This file was deleted.

25 changes: 11 additions & 14 deletions Emoji Switcher/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
<resources>

<style name="EmojiSwitcher" parent="android:Theme.Holo.Light">
<style name="EmojiSwitcher" parent="Theme.AppCompat.Light">
<item name="colorPrimary">@color/emojiswitcher_orange</item>
<item name="colorPrimaryDark">@color/emojiswitcher_orange_dark</item>
<item name="colorAccent">@color/emojiswitcher_orange_faded1</item>
<item name="colorButtonNormal">@color/emojiswitcher_orange_faded2</item>

<item name="autoScaleTextViewStyle">@style/EmojiSwitcher.AutoScaleTextView</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:actionBarStyle">@style/EmojiSwitcher.ActionBar</item>
<item name="android:buttonStyle">@style/EmojiSwitcher.Button</item>
<item name="android:listSelector">@drawable/button</item>
<item name="windowActionBarOverlay">true</item>
<item name="actionBarStyle">@style/EmojiSwitcher.ActionBar</item>
<item name="android:divider">@drawable/divider</item>
<item name="android:dividerPadding">8dp</item>
</style>

<style name="EmojiSwitcher.ActionBar" parent="android:Widget.Holo.Light.ActionBar">
<item name="android:background">@color/emojiswitcher_orange_transparent</item>
<style name="EmojiSwitcher.ActionBar" parent="Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">@color/emojiswitcher_orange_transparent</item>
</style>

<style name="EmojiSwitcher.AutoScaleTextView">
<item name="minTextSize">12sp</item>
</style>

<style name="EmojiSwitcher.Button" parent="android:Widget.Holo.Light.Button">
<item name="android:background">@drawable/button</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">8dp</item>
</style>

<style name="EmojiSwitcher.Button.Round" parent="android:Widget.Holo.Light.Button">
<style name="EmojiSwitcher.ButtonRound" parent="android:Widget.ImageButton">
<item name="android:background">@drawable/button_round</item>
</style>

Expand Down

0 comments on commit 5fe9d66

Please sign in to comment.