diff --git a/shell/android/jni/Android.mk b/shell/android/jni/Android.mk index dbda2857f..6b39775ab 100644 --- a/shell/android/jni/Android.mk +++ b/shell/android/jni/Android.mk @@ -64,12 +64,6 @@ LOCAL_ARM_MODE := arm include $(BUILD_SHARED_LIBRARY) -$(call import-module,android/native_app_glue) - -LOCAL_CERTIFICATE := shared - -LOCAL_PATH:= $(call my-dir)/.. - include $(CLEAR_VARS) LOCAL_MODULE := sexplay diff --git a/shell/android/res/values/strings.xml b/shell/android/res/values/strings.xml index b62a234eb..5878540d6 100644 --- a/shell/android/res/values/strings.xml +++ b/shell/android/res/values/strings.xml @@ -22,7 +22,7 @@ Optimization and Debugging Options Expert (May cause widespread panic) - Disable Native Interface + Enable Native Interface Dynarec Options Unstable Optimisations DC Region diff --git a/shell/android/src/com/reicast/emulator/AboutFragment.java b/shell/android/src/com/reicast/emulator/AboutFragment.java index 324087aa2..28f48973d 100644 --- a/shell/android/src/com/reicast/emulator/AboutFragment.java +++ b/shell/android/src/com/reicast/emulator/AboutFragment.java @@ -91,7 +91,6 @@ import android.widget.ListView; import android.widget.SlidingDrawer; import android.widget.SlidingDrawer.OnDrawerOpenListener; import android.widget.TextView; -import android.widget.Toast; import com.reicast.emulator.config.Config; import com.reicast.emulator.debug.GitAdapter; diff --git a/shell/android/src/com/reicast/emulator/FileBrowser.java b/shell/android/src/com/reicast/emulator/FileBrowser.java index 08af1323c..33f8a88b6 100644 --- a/shell/android/src/com/reicast/emulator/FileBrowser.java +++ b/shell/android/src/com/reicast/emulator/FileBrowser.java @@ -41,6 +41,7 @@ import android.widget.TextView; import android.widget.Toast; import com.android.util.FileUtils; +import com.reicast.emulator.config.Config; import com.reicast.emulator.emu.JNIdc; public class FileBrowser extends Fragment { @@ -62,8 +63,8 @@ public class FileBrowser extends Fragment { super.onCreate(savedInstanceState); mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); - home_directory = mPrefs.getString("home_directory", home_directory); - game_directory = mPrefs.getString("game_directory", game_directory); + home_directory = mPrefs.getString(Config.pref_home, home_directory); + game_directory = mPrefs.getString(Config.pref_games, game_directory); Bundle b = getArguments(); if (b != null) { @@ -413,12 +414,12 @@ public class FileBrowser extends Fragment { if (games) { game_directory = heading; mPrefs.edit() - .putString("game_directory", + .putString(Config.pref_games, heading).commit(); } else { home_directory = heading; mPrefs.edit() - .putString("home_directory", + .putString(Config.pref_home, heading).commit(); File data_directory = new File(heading, "data"); diff --git a/shell/android/src/com/reicast/emulator/GL2JNIActivity.java b/shell/android/src/com/reicast/emulator/GL2JNIActivity.java index 9fec4ed90..156358b07 100644 --- a/shell/android/src/com/reicast/emulator/GL2JNIActivity.java +++ b/shell/android/src/com/reicast/emulator/GL2JNIActivity.java @@ -82,13 +82,13 @@ public class GL2JNIActivity extends Activity { // Populate device descriptor-to-player-map from preferences pad.deviceDescriptor_PlayerNum.put( - prefs.getString("device_descriptor_player_1", null), 0); + prefs.getString(Gamepad.pref_player1, null), 0); pad.deviceDescriptor_PlayerNum.put( - prefs.getString("device_descriptor_player_2", null), 1); + prefs.getString(Gamepad.pref_player2, null), 1); pad.deviceDescriptor_PlayerNum.put( - prefs.getString("device_descriptor_player_3", null), 2); + prefs.getString(Gamepad.pref_player3, null), 2); pad.deviceDescriptor_PlayerNum.put( - prefs.getString("device_descriptor_player_4", null), 3); + prefs.getString(Gamepad.pref_player4, null), 3); pad.deviceDescriptor_PlayerNum.remove(null); moga.onCreate(this, pad); @@ -144,23 +144,23 @@ public class GL2JNIActivity extends Activity { if (playerNum != null) { String id = pad.portId[playerNum]; - pad.custom[playerNum] = prefs.getBoolean("modified_key_layout" + id, false); - pad.compat[playerNum] = prefs.getBoolean("controller_compat" + id, false); - pad.joystick[playerNum] = prefs.getBoolean("separate_joystick" + id, true); + pad.custom[playerNum] = prefs.getBoolean(Gamepad.pref_js_modified + id, false); + pad.compat[playerNum] = prefs.getBoolean(Gamepad.pref_js_compat + id, false); + pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_separate + id, true); if (!pad.compat[playerNum]) { if (pad.custom[playerNum]) { pad.map[playerNum] = pad.setModifiedKeys(id, playerNum, prefs); } else if (InputDevice.getDevice(joy).getName() - .equals("Sony PLAYSTATION(R)3 Controller")) { + .equals(Gamepad.controllers_sony)) { pad.map[playerNum] = pad.getConsoleController(); } else if (InputDevice.getDevice(joy).getName() - .equals("Microsoft X-Box 360 pad")) { + .equals(Gamepad.controllers_xbox)) { pad.map[playerNum] = pad.getConsoleController(); } else if (InputDevice.getDevice(joy).getName() - .contains("NVIDIA Corporation NVIDIA Controller")) { + .contains(Gamepad.controllers_shield)) { pad.map[playerNum] = pad.getConsoleController(); } else if (InputDevice.getDevice(joy).getName() - .contains("keypad-zeus")) { + .contains(Gamepad.controllers_play)) { pad.map[playerNum] = pad.getXPlayController(); } else if (!pad.isActiveMoga[playerNum]) { // Ouya controller pad.map[playerNum] = pad.getOUYAController(); @@ -187,11 +187,11 @@ public class GL2JNIActivity extends Activity { // Create the actual GLES view mView = new GL2JNIView(getApplication(), config, fileName, false, - prefs.getInt("depth_render", 24), 0, false); + prefs.getInt(Config.pref_renderdepth, 24), 0, false); setContentView(mView); //setup mic - boolean micPluggedIn = prefs.getBoolean("mic_plugged_in", false); + boolean micPluggedIn = prefs.getBoolean(Config.pref_mic, false); if(micPluggedIn){ SipEmulator sip = new SipEmulator(); sip.startRecording(); @@ -200,10 +200,10 @@ public class GL2JNIActivity extends Activity { popUp = menu.new MainPopup(this); vmuPop = menu.new VmuPopup(this); - if(prefs.getBoolean("vmu_floating", false)){ + if(prefs.getBoolean(Config.pref_vmu, false)){ //kind of a hack - if the user last had the vmu on screen //inverse it and then "toggle" - prefs.edit().putBoolean("vmu_floating", false).commit(); + prefs.edit().putBoolean(Config.pref_vmu, false).commit(); //can only display a popup after onCreate mView.post(new Runnable() { public void run() { @@ -212,7 +212,7 @@ public class GL2JNIActivity extends Activity { }); } JNIdc.setupVmu(menu.getVmu()); - if (prefs.getBoolean("show_fps", false)) { + if (prefs.getBoolean(Config.pref_showfps, false)) { fpsPop = menu.new FpsPopup(this); mView.setFpsDisplay(fpsPop); mView.post(new Runnable() { @@ -238,7 +238,7 @@ public class GL2JNIActivity extends Activity { } private void getCompatibilityMap(int playerNum, String id) { - pad.name[playerNum] = prefs.getInt("controller" + id, -1); + pad.name[playerNum] = prefs.getInt(Gamepad.pref_pad + id, -1); if (pad.name[playerNum] != -1) { pad.map[playerNum] = pad.setModifiedKeys(id, playerNum, prefs); } @@ -382,7 +382,7 @@ public class GL2JNIActivity extends Activity { } public void toggleVmu() { - boolean showFloating = !prefs.getBoolean("vmu_floating", false); + boolean showFloating = !prefs.getBoolean(Config.pref_vmu, false); if(showFloating){ if(popUp.isShowing()){ popUp.dismiss(); @@ -402,7 +402,7 @@ public class GL2JNIActivity extends Activity { //add back to popup menu popUp.showVmu(); } - prefs.edit().putBoolean("vmu_floating", showFloating).commit(); + prefs.edit().putBoolean(Config.pref_vmu, showFloating).commit(); } public void displayConfig(PopupWindow popUpConfig) { @@ -427,9 +427,9 @@ public class GL2JNIActivity extends Activity { if (playerNum != null && playerNum != -1) { if (pad.compat[playerNum] || pad.custom[playerNum]) { String id = pad.portId[playerNum]; - if (keyCode == prefs.getInt("l_button" + id, + if (keyCode == prefs.getInt(Gamepad.pref_button_l + id, KeyEvent.KEYCODE_BUTTON_L1) - || keyCode == prefs.getInt("r_button" + id, + || keyCode == prefs.getInt(Gamepad.pref_button_r + id, KeyEvent.KEYCODE_BUTTON_R1)) { return simulatedTouchEvent(playerNum, 0.0f, 0.0f); } @@ -452,10 +452,10 @@ public class GL2JNIActivity extends Activity { if (playerNum != null && playerNum != -1) { if (pad.compat[playerNum] || pad.custom[playerNum]) { String id = pad.portId[playerNum]; - if (keyCode == prefs.getInt("l_button" + id, KeyEvent.KEYCODE_BUTTON_L1)) { + if (keyCode == prefs.getInt(Gamepad.pref_button_l + id, KeyEvent.KEYCODE_BUTTON_L1)) { return simulatedTouchEvent(playerNum, 1.0f, 0.0f); } - if (keyCode == prefs.getInt("r_button" + id, KeyEvent.KEYCODE_BUTTON_R1)) { + if (keyCode == prefs.getInt(Gamepad.pref_button_r + id, KeyEvent.KEYCODE_BUTTON_R1)) { return simulatedTouchEvent(playerNum, 0.0f, 1.0f); } } diff --git a/shell/android/src/com/reicast/emulator/GL2JNINative.java b/shell/android/src/com/reicast/emulator/GL2JNINative.java index 2a2393fb5..49b9d25fc 100644 --- a/shell/android/src/com/reicast/emulator/GL2JNINative.java +++ b/shell/android/src/com/reicast/emulator/GL2JNINative.java @@ -81,13 +81,13 @@ public class GL2JNINative extends NativeActivity { // Populate device descriptor-to-player-map from preferences pad.deviceDescriptor_PlayerNum.put( - prefs.getString("device_descriptor_player_1", null), 0); + prefs.getString(Gamepad.pref_player1, null), 0); pad.deviceDescriptor_PlayerNum.put( - prefs.getString("device_descriptor_player_2", null), 1); + prefs.getString(Gamepad.pref_player2, null), 1); pad.deviceDescriptor_PlayerNum.put( - prefs.getString("device_descriptor_player_3", null), 2); + prefs.getString(Gamepad.pref_player3, null), 2); pad.deviceDescriptor_PlayerNum.put( - prefs.getString("device_descriptor_player_4", null), 3); + prefs.getString(Gamepad.pref_player4, null), 3); pad.deviceDescriptor_PlayerNum.remove(null); moga.onCreate(this, pad); @@ -135,7 +135,7 @@ public class GL2JNINative extends NativeActivity { + InputDevice.getDevice(joy).getName()); if (pad.isXperiaPlay) { if (InputDevice.getDevice(joy).getName() - .contains("keypad-game-zeus")) { + .contains(Gamepad.controllers_play_gp)) { pad.keypadZeus.add(joy); } if (InputDevice.getDevice(joy).getName() @@ -154,11 +154,11 @@ public class GL2JNINative extends NativeActivity { if (playerNum != null) { String id = pad.portId[playerNum]; - pad.custom[playerNum] = prefs.getBoolean("modified_key_layout" + id, false); - pad.compat[playerNum] = prefs.getBoolean("controller_compat" + id, false); - pad.joystick[playerNum] = prefs.getBoolean("separate_joystick" + id, false); + pad.custom[playerNum] = prefs.getBoolean(Gamepad.pref_js_modified + id, false); + pad.compat[playerNum] = prefs.getBoolean(Gamepad.pref_js_compat + id, false); + pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_separate + id, false); if (InputDevice.getDevice(joy).getName() - .contains("keypad-zeus")) { + .contains(Gamepad.controllers_play)) { pad.playerNumX.put(joy, playerNum); for (int keys : pad.keypadZeus) { pad.playerNumX.put(keys, playerNum); @@ -173,13 +173,13 @@ public class GL2JNINative extends NativeActivity { if (pad.custom[playerNum]) { setCustomMapping(id, playerNum); } else if (InputDevice.getDevice(joy).getName() - .equals("Sony PLAYSTATION(R)3 Controller")) { + .equals(Gamepad.controllers_sony)) { pad.map[playerNum] = pad.getConsoleController(); } else if (InputDevice.getDevice(joy).getName() - .equals("Microsoft X-Box 360 pad")) { + .equals(Gamepad.controllers_xbox)) { pad.map[playerNum] = pad.getConsoleController(); } else if (InputDevice.getDevice(joy).getName() - .contains("NVIDIA Corporation NVIDIA Controller")) { + .contains(Gamepad.controllers_shield)) { pad.map[playerNum] = pad.getConsoleController(); } else if (!pad.isActiveMoga[playerNum]) { // Ouya controller pad.map[playerNum] = pad.getOUYAController(); @@ -205,11 +205,11 @@ public class GL2JNINative extends NativeActivity { // Create the actual GLES view mView = new GL2JNIView(getApplication(), config, fileName, false, - prefs.getInt("depth_render", 24), 0, false); + prefs.getInt(Config.pref_renderdepth, 24), 0, false); setContentView(mView); //setup mic - boolean micPluggedIn = prefs.getBoolean("mic_plugged_in", false); + boolean micPluggedIn = prefs.getBoolean(Config.pref_mic, false); if(micPluggedIn){ SipEmulator sip = new SipEmulator(); sip.startRecording(); @@ -218,10 +218,10 @@ public class GL2JNINative extends NativeActivity { popUp = menu.new MainPopup(this); vmuPop = menu.new VmuPopup(this); - if(prefs.getBoolean("vmu_floating", false)){ + if(prefs.getBoolean(Config.pref_vmu, false)){ //kind of a hack - if the user last had the vmu on screen //inverse it and then "toggle" - prefs.edit().putBoolean("vmu_floating", false).commit(); + prefs.edit().putBoolean(Config.pref_vmu, false).commit(); //can only display a popup after onCreate mView.post(new Runnable() { public void run() { @@ -230,7 +230,7 @@ public class GL2JNINative extends NativeActivity { }); } JNIdc.setupVmu(menu.getVmu()); - if (prefs.getBoolean("show_fps", false)) { + if (prefs.getBoolean(Config.pref_showfps, false)) { fpsPop = menu.new FpsPopup(this); mView.setFpsDisplay(fpsPop); mView.post(new Runnable() { @@ -302,7 +302,7 @@ public class GL2JNINative extends NativeActivity { } public void toggleVmu() { - boolean showFloating = !prefs.getBoolean("vmu_floating", false); + boolean showFloating = !prefs.getBoolean(Config.pref_vmu, false); if(showFloating){ if(popUp.isShowing()){ popUp.dismiss(); @@ -322,7 +322,7 @@ public class GL2JNINative extends NativeActivity { //add back to popup menu popUp.showVmu(); } - prefs.edit().putBoolean("vmu_floating", showFloating).commit(); + prefs.edit().putBoolean(Config.pref_vmu, showFloating).commit(); } public void displayConfig(PopupWindow popUpConfig) { @@ -477,9 +477,9 @@ public class GL2JNINative extends NativeActivity { if (playerNum != null && playerNum != -1) { String id = pad.portId[playerNum]; if (action == KeyEvent.ACTION_DOWN) { - if (keyCode == prefs.getInt("l_button" + id, KeyEvent.KEYCODE_BUTTON_L1)) { + if (keyCode == prefs.getInt(Gamepad.pref_button_l + id, KeyEvent.KEYCODE_BUTTON_L1)) { return simulatedTouchEvent(playerNum, 1.0f, 0.0f); - } else if (keyCode == prefs.getInt("r_button" + id, KeyEvent.KEYCODE_BUTTON_R1)) { + } else if (keyCode == prefs.getInt(Gamepad.pref_button_r + id, KeyEvent.KEYCODE_BUTTON_R1)) { return simulatedTouchEvent(playerNum, 0.0f, 1.0f); } else if (handle_key(playerNum, keyCode, true)) { if (playerNum == 0) @@ -488,9 +488,9 @@ public class GL2JNINative extends NativeActivity { } } if (action == KeyEvent.ACTION_UP) { - if (keyCode == prefs.getInt("l_button" + id, + if (keyCode == prefs.getInt(Gamepad.pref_button_l + id, KeyEvent.KEYCODE_BUTTON_L1) - || keyCode == prefs.getInt("r_button" + id, + || keyCode == prefs.getInt(Gamepad.pref_button_r + id, KeyEvent.KEYCODE_BUTTON_R1)) { return simulatedTouchEvent(playerNum, 0.0f, 0.0f); } else { diff --git a/shell/android/src/com/reicast/emulator/MainActivity.java b/shell/android/src/com/reicast/emulator/MainActivity.java index 7253d8610..97282eafa 100644 --- a/shell/android/src/com/reicast/emulator/MainActivity.java +++ b/shell/android/src/com/reicast/emulator/MainActivity.java @@ -408,7 +408,7 @@ public class MainActivity extends SlidingFragmentActivity implements // show it alertDialog.show(); } else { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && !Config.nonative) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && Config.nativeact) { startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(), GL2JNINative.class)); } else { diff --git a/shell/android/src/com/reicast/emulator/config/Config.java b/shell/android/src/com/reicast/emulator/config/Config.java index e95820865..5cb8feac4 100644 --- a/shell/android/src/com/reicast/emulator/config/Config.java +++ b/shell/android/src/com/reicast/emulator/config/Config.java @@ -23,6 +23,32 @@ import com.reicast.emulator.emu.JNIdc; public class Config { + public static final String pref_home = "home_directory"; + public static final String pref_games = "game_directory"; + + public static final String pref_nativeact = "enable_native"; + public static final String pref_dynarecopt = "dynarec_opt"; + public static final String pref_unstable = "unstable_opt"; + public static final String pref_cable = "dc_cable"; + public static final String pref_dcregion = "dc_region"; + public static final String pref_broadcast = "dc_broadcast"; + public static final String pref_limitfps = "limit_fps"; + public static final String pref_nosound = "sound_disabled"; + public static final String pref_mipmaps = "use_mipmaps"; + public static final String pref_widescreen = "stretch_view"; + public static final String pref_frameskip = "frame_skip"; + public static final String pref_pvrrender = "pvr_render"; + public static final String pref_cheatdisk = "cheat_disk"; + + public static final String pref_showfps = "show_fps"; + public static final String pref_forcegpu = "force_gpu"; + public static final String pref_rendertype = "render_type"; + public static final String pref_renderdepth = "depth_render"; + + public static final String pref_touchvibe = "touch_vibration_enabled"; + public static final String pref_mic = "mic_plugged_in"; + public static final String pref_vmu = "vmu_floating"; + public static boolean dynarecopt = true; public static boolean idleskip = true; public static boolean unstableopt = false; @@ -38,7 +64,7 @@ public class Config { public static int frameskip = 0; public static boolean pvrrender = false; public static String cheatdisk = "null"; - public static boolean nonative = false; + public static boolean nativeact = false; private SharedPreferences mPrefs; @@ -51,19 +77,19 @@ public class Config { * */ public void getConfigurationPrefs() { - Config.dynarecopt = mPrefs.getBoolean("dynarec_opt", dynarecopt); - Config.unstableopt = mPrefs.getBoolean("unstable_opt", unstableopt); - Config.cable = mPrefs.getInt("dc_cable", cable); - Config.dcregion = mPrefs.getInt("dc_region", dcregion); - Config.broadcast = mPrefs.getInt("dc_broadcast", broadcast); - Config.limitfps = mPrefs.getBoolean("limit_fps", limitfps); - Config.nosound = mPrefs.getBoolean("sound_disabled", nosound); - Config.mipmaps = mPrefs.getBoolean("use_mipmaps", mipmaps); - Config.widescreen = mPrefs.getBoolean("stretch_view", widescreen); - Config.frameskip = mPrefs.getInt("frame_skip", frameskip); - Config.pvrrender = mPrefs.getBoolean("pvr_render", pvrrender); - Config.cheatdisk = mPrefs.getString("cheat_disk", cheatdisk); - Config.nonative = mPrefs.getBoolean("native_override", nonative); + Config.dynarecopt = mPrefs.getBoolean(pref_dynarecopt, dynarecopt); + Config.unstableopt = mPrefs.getBoolean(pref_unstable, unstableopt); + Config.cable = mPrefs.getInt(pref_cable, cable); + Config.dcregion = mPrefs.getInt(pref_dcregion, dcregion); + Config.broadcast = mPrefs.getInt(pref_broadcast, broadcast); + Config.limitfps = mPrefs.getBoolean(pref_limitfps, limitfps); + Config.nosound = mPrefs.getBoolean(pref_nosound, nosound); + Config.mipmaps = mPrefs.getBoolean(pref_mipmaps, mipmaps); + Config.widescreen = mPrefs.getBoolean(pref_widescreen, widescreen); + Config.frameskip = mPrefs.getInt(pref_frameskip, frameskip); + Config.pvrrender = mPrefs.getBoolean(pref_pvrrender, pvrrender); + Config.cheatdisk = mPrefs.getString(pref_cheatdisk, cheatdisk); + Config.nativeact = mPrefs.getBoolean(pref_nativeact, nativeact); } /** diff --git a/shell/android/src/com/reicast/emulator/config/ConfigureFragment.java b/shell/android/src/com/reicast/emulator/config/ConfigureFragment.java index b3807aed3..2e6fb5953 100644 --- a/shell/android/src/com/reicast/emulator/config/ConfigureFragment.java +++ b/shell/android/src/com/reicast/emulator/config/ConfigureFragment.java @@ -66,7 +66,7 @@ public class ConfigureFragment extends Fragment { mPrefs = PreferenceManager.getDefaultSharedPreferences(parentActivity); - home_directory = mPrefs.getString("home_directory", home_directory); + home_directory = mPrefs.getString(Config.pref_home, home_directory); config = new Config(parentActivity); config.getConfigurationPrefs(); @@ -76,20 +76,20 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("native_override", isChecked).commit(); - Config.nonative = isChecked; + mPrefs.edit().putBoolean(Config.pref_nativeact, isChecked).commit(); + Config.nativeact = isChecked; } }; Switch native_opt = (Switch) getView().findViewById( R.id.native_option); - native_opt.setChecked(Config.nonative); + native_opt.setChecked(Config.nativeact); native_opt.setOnCheckedChangeListener(native_options); OnCheckedChangeListener dynarec_options = new OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("dynarec_opt", isChecked).commit(); + mPrefs.edit().putBoolean(Config.pref_dynarecopt, isChecked).commit(); Config.dynarecopt = isChecked; } }; @@ -102,7 +102,7 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("unstable_opt", isChecked).commit(); + mPrefs.edit().putBoolean(Config.pref_unstable, isChecked).commit(); Config.unstableopt = isChecked; } }; @@ -115,8 +115,9 @@ public class ConfigureFragment extends Fragment { } unstable_opt.setOnCheckedChangeListener(unstable_option); - String[] regions = parentActivity.getResources().getStringArray( - R.array.region); + String[] regions = parentActivity.getResources() + .getStringArray(R.array.region); + Spinner region_spnr = (Spinner) getView().findViewById( R.id.region_spinner); ArrayAdapter regionAdapter = new ArrayAdapter( @@ -131,7 +132,7 @@ public class ConfigureFragment extends Fragment { public void onItemSelected(AdapterView parent, View view, int pos, long id) { - mPrefs.edit().putInt("dc_region", pos).commit(); + mPrefs.edit().putInt(Config.pref_dcregion, pos).commit(); Config.dcregion = pos; } @@ -167,7 +168,7 @@ public class ConfigureFragment extends Fragment { String item = parent.getItemAtPosition(pos).toString(); String selection = item.substring(0, item.indexOf(" - ")); mPrefs.edit() - .putInt("dc_broadcast", Integer.valueOf(selection)) + .putInt(Config.pref_broadcast, Integer.valueOf(selection)) .commit(); Config.broadcast = Integer.valueOf(selection); @@ -183,7 +184,7 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("limit_fps", isChecked).commit(); + mPrefs.edit().putBoolean(Config.pref_limitfps, isChecked).commit(); Config.limitfps = isChecked; } }; @@ -196,7 +197,7 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("use_mipmaps", isChecked).commit(); + mPrefs.edit().putBoolean(Config.pref_mipmaps, isChecked).commit(); Config.mipmaps = isChecked; } }; @@ -209,7 +210,7 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("stretch_view", isChecked).commit(); + mPrefs.edit().putBoolean(Config.pref_widescreen, isChecked).commit(); Config.widescreen = isChecked; } }; @@ -237,7 +238,7 @@ public class ConfigureFragment extends Fragment { public void onStopTrackingTouch(SeekBar seekBar) { int progress = seekBar.getProgress(); - mPrefs.edit().putInt("frame_skip", progress).commit(); + mPrefs.edit().putInt(Config.pref_frameskip, progress).commit(); Config.frameskip = progress; } }); @@ -246,7 +247,7 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("pvr_render", isChecked).commit(); + mPrefs.edit().putBoolean(Config.pref_pvrrender, isChecked).commit(); Config.pvrrender = isChecked; } }; @@ -274,7 +275,7 @@ public class ConfigureFragment extends Fragment { } else { cheatEdit.setText(disk); } - mPrefs.edit().putString("cheat_disk", disk).commit(); + mPrefs.edit().putString(Config.pref_cheatdisk, disk).commit(); Config.cheatdisk = disk; } } @@ -293,10 +294,10 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("show_fps", isChecked).commit(); + mPrefs.edit().putBoolean(Config.pref_showfps, isChecked).commit(); } }; - boolean counter = mPrefs.getBoolean("show_fps", false); + boolean counter = mPrefs.getBoolean(Config.pref_showfps, false); fps_opt.setChecked(counter); fps_opt.setOnCheckedChangeListener(fps_options); @@ -307,10 +308,10 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("force_gpu", isChecked).commit(); + mPrefs.edit().putBoolean(Config.pref_forcegpu, isChecked).commit(); } }; - boolean enhanced = mPrefs.getBoolean("force_gpu", true); + boolean enhanced = mPrefs.getBoolean(Config.pref_forcegpu, true); force_gpu_opt.setChecked(enhanced); force_gpu_opt.setOnCheckedChangeListener(force_gpu_options); } else { @@ -323,18 +324,18 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putInt("render_type", isChecked ? 1 : 2).commit(); + mPrefs.edit().putInt(Config.pref_rendertype, isChecked ? 1 : 2).commit(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { if (isChecked) { force_gpu_opt.setEnabled(false); - mPrefs.edit().putBoolean("force_gpu", false).commit(); + mPrefs.edit().putBoolean(Config.pref_forcegpu, false).commit(); } else { force_gpu_opt.setEnabled(true); } } } }; - int software = mPrefs.getInt("render_type", + int software = mPrefs.getInt(Config.pref_rendertype, GL2JNIView.LAYER_TYPE_HARDWARE); force_software_opt .setChecked(software == GL2JNIView.LAYER_TYPE_SOFTWARE); @@ -345,11 +346,11 @@ public class ConfigureFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mPrefs.edit().putBoolean("sound_disabled", isChecked).commit(); + mPrefs.edit().putBoolean(Config.pref_nosound, isChecked).commit(); Config.nosound = isChecked; } }; - boolean sound = mPrefs.getBoolean("sound_disabled", false); + boolean sound = mPrefs.getBoolean(Config.pref_nosound, false); sound_opt.setChecked(sound); sound_opt.setOnCheckedChangeListener(emu_sound); @@ -364,7 +365,7 @@ public class ConfigureFragment extends Fragment { .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); depth_spnr.setAdapter(depthAdapter); - String depth = String.valueOf(mPrefs.getInt("depth_render", 24)); + String depth = String.valueOf(mPrefs.getInt(Config.pref_renderdepth, 24)); depth_spnr.setSelection(depthAdapter.getPosition(depth), true); depth_spnr.setOnItemSelectedListener(new OnItemSelectedListener() { @@ -373,7 +374,7 @@ public class ConfigureFragment extends Fragment { int pos, long id) { int render = Integer.valueOf(parent.getItemAtPosition(pos) .toString()); - mPrefs.edit().putInt("depth_render", render).commit(); + mPrefs.edit().putInt(Config.pref_renderdepth, render).commit(); } diff --git a/shell/android/src/com/reicast/emulator/config/EditVJoyActivity.java b/shell/android/src/com/reicast/emulator/config/EditVJoyActivity.java index 87ca455e4..9e5250878 100644 --- a/shell/android/src/com/reicast/emulator/config/EditVJoyActivity.java +++ b/shell/android/src/com/reicast/emulator/config/EditVJoyActivity.java @@ -62,7 +62,7 @@ public class EditVJoyActivity extends Activity { // Create the actual GLES view mView = new GL2JNIView(getApplication(), config, null, false, - prefs.getInt("depth_render", 24), 0, true); + prefs.getInt(Config.pref_renderdepth, 24), 0, true); mView.setFpsDisplay(null); setContentView(mView); diff --git a/shell/android/src/com/reicast/emulator/config/InputFragment.java b/shell/android/src/com/reicast/emulator/config/InputFragment.java index 3b91eccdb..c6b791b9a 100644 --- a/shell/android/src/com/reicast/emulator/config/InputFragment.java +++ b/shell/android/src/com/reicast/emulator/config/InputFragment.java @@ -63,12 +63,12 @@ public class InputFragment extends Fragment { @Override public void onViewCreated(View view, Bundle savedInstanceState) { parentActivity = getActivity(); - + moga.onCreate(parentActivity, pad); sharedPreferences = PreferenceManager .getDefaultSharedPreferences(parentActivity); - + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ImageView icon_a = (ImageView) getView().findViewById( R.id.controller_icon_a); @@ -100,118 +100,131 @@ public class InputFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { sharedPreferences.edit() - .putBoolean("touch_vibration_enabled", isChecked) - .commit(); + .putBoolean(Config.pref_touchvibe, isChecked).commit(); } }; switchTouchVibrationEnabled = (Switch) getView().findViewById( R.id.switchTouchVibrationEnabled); - boolean vibrate = sharedPreferences.getBoolean( - "touch_vibration_enabled", true); + boolean vibrate = sharedPreferences.getBoolean(Config.pref_touchvibe, + true); if (vibrate) { switchTouchVibrationEnabled.setChecked(true); } else { switchTouchVibrationEnabled.setChecked(false); } switchTouchVibrationEnabled.setOnCheckedChangeListener(touch_vibration); - + micPluggedIntoFirstController = (Switch) getView().findViewById( R.id.micInPort2); - boolean micPluggedIn = sharedPreferences.getBoolean("mic_plugged_in", false); + boolean micPluggedIn = sharedPreferences.getBoolean(Config.pref_mic, + false); micPluggedIntoFirstController.setChecked(micPluggedIn); if (getActivity().getPackageManager().hasSystemFeature( "android.hardware.microphone")) { - //Microphone is present on the device - micPluggedIntoFirstController.setOnCheckedChangeListener(new OnCheckedChangeListener() { - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - sharedPreferences.edit().putBoolean("mic_plugged_in", isChecked).commit(); - } - }); - }else{ + // Microphone is present on the device + micPluggedIntoFirstController + .setOnCheckedChangeListener(new OnCheckedChangeListener() { + public void onCheckedChanged(CompoundButton buttonView, + boolean isChecked) { + sharedPreferences.edit() + .putBoolean(Config.pref_mic, isChecked) + .commit(); + } + }); + } else { micPluggedIntoFirstController.setEnabled(false); } - - + Button buttonKeycodeEditor = (Button) getView().findViewById( R.id.buttonKeycodeEditor); buttonKeycodeEditor.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { InputModFragment inputModFrag = new InputModFragment(); - getActivity().getSupportFragmentManager() - .beginTransaction() - .replace(R.id.fragment_container, inputModFrag, - "INPUT_MOD_FRAG").addToBackStack(null).commit(); + getActivity() + .getSupportFragmentManager() + .beginTransaction() + .replace(R.id.fragment_container, inputModFrag, + "INPUT_MOD_FRAG").addToBackStack(null).commit(); } }); - + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { Button buttonSelectControllerPlayer1 = (Button) getView() .findViewById(R.id.buttonSelectControllerPlayer1); - buttonSelectControllerPlayer1.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - selectController(1); - } - }); + buttonSelectControllerPlayer1 + .setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + selectController(1); + } + }); Button buttonSelectControllerPlayer2 = (Button) getView() .findViewById(R.id.buttonSelectControllerPlayer2); - buttonSelectControllerPlayer2.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - selectController(2); - } - }); + buttonSelectControllerPlayer2 + .setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + selectController(2); + } + }); Button buttonSelectControllerPlayer3 = (Button) getView() .findViewById(R.id.buttonSelectControllerPlayer3); - buttonSelectControllerPlayer3.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - selectController(3); - } - }); + buttonSelectControllerPlayer3 + .setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + selectController(3); + } + }); Button buttonSelectControllerPlayer4 = (Button) getView() .findViewById(R.id.buttonSelectControllerPlayer4); - buttonSelectControllerPlayer4.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - selectController(4); - } - }); + buttonSelectControllerPlayer4 + .setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + selectController(4); + } + }); Button buttonRemoveControllerPlayer1 = (Button) getView() .findViewById(R.id.buttonRemoveControllerPlayer1); - buttonRemoveControllerPlayer1.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - removeController(1); - } - }); + buttonRemoveControllerPlayer1 + .setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + removeController(1); + } + }); Button buttonRemoveControllerPlayer2 = (Button) getView() .findViewById(R.id.buttonRemoveControllerPlayer2); - buttonRemoveControllerPlayer2.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - removeController(2); - } - }); + buttonRemoveControllerPlayer2 + .setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + removeController(2); + } + }); Button buttonRemoveControllerPlayer3 = (Button) getView() .findViewById(R.id.buttonRemoveControllerPlayer3); - buttonRemoveControllerPlayer3.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - removeController(3); - } - }); + buttonRemoveControllerPlayer3 + .setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + removeController(3); + } + }); Button buttonRemoveControllerPlayer4 = (Button) getView() .findViewById(R.id.buttonRemoveControllerPlayer4); - buttonRemoveControllerPlayer4.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - removeController(4); - } - }); + buttonRemoveControllerPlayer4 + .setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + removeController(4); + } + }); updateControllers(); - + } else { - TableLayout input_devices = (TableLayout) parentActivity.findViewById(R.id.input_devices); + TableLayout input_devices = (TableLayout) parentActivity + .findViewById(R.id.input_devices); input_devices.setVisibility(View.GONE); } @@ -221,19 +234,19 @@ public class InputFragment extends Fragment { private void updateVibration() { boolean touchVibrationEnabled = sharedPreferences.getBoolean( - "touch_vibration_enabled", true); + Config.pref_touchvibe, true); switchTouchVibrationEnabled.setChecked(touchVibrationEnabled); } private void updateControllers() { String deviceDescriptorPlayer1 = sharedPreferences.getString( - "device_descriptor_player_1", null); + Gamepad.pref_player1, null); String deviceDescriptorPlayer2 = sharedPreferences.getString( - "device_descriptor_player_2", null); + Gamepad.pref_player2, null); String deviceDescriptorPlayer3 = sharedPreferences.getString( - "device_descriptor_player_3", null); + Gamepad.pref_player3, null); String deviceDescriptorPlayer4 = sharedPreferences.getString( - "device_descriptor_player_4", null); + Gamepad.pref_player4, null); String labelPlayer1 = null, labelPlayer2 = null, labelPlayer3 = null, labelPlayer4 = null; @@ -361,10 +374,12 @@ public class InputFragment extends Fragment { args.putInt("portNumber", listenForButton - 1); inputModFrag.setArguments(args); listenForButton = 0; - getActivity().getSupportFragmentManager() - .beginTransaction() - .replace(R.id.fragment_container, inputModFrag, - "INPUT_MOD_FRAG").addToBackStack(null).commit(); + getActivity() + .getSupportFragmentManager() + .beginTransaction() + .replace(R.id.fragment_container, inputModFrag, + "INPUT_MOD_FRAG").addToBackStack(null) + .commit(); dialog.dismiss(); } }); @@ -394,23 +409,22 @@ public class InputFragment extends Fragment { descriptor = config.getController(); } descriptor = InputDevice.getDevice(event.getDeviceId()) - .getDescriptor(); + .getDescriptor(); } else { - descriptor = InputDevice.getDevice(event.getDeviceId()) - .getName(); + descriptor = InputDevice.getDevice(event.getDeviceId()).getName(); } if (descriptor == null) return false; String deviceDescriptorPlayer1 = sharedPreferences.getString( - "device_descriptor_player_1", null); + Gamepad.pref_player1, null); String deviceDescriptorPlayer2 = sharedPreferences.getString( - "device_descriptor_player_2", null); + Gamepad.pref_player2, null); String deviceDescriptorPlayer3 = sharedPreferences.getString( - "device_descriptor_player_3", null); + Gamepad.pref_player3, null); String deviceDescriptorPlayer4 = sharedPreferences.getString( - "device_descriptor_player_4", null); + Gamepad.pref_player4, null); if (descriptor.equals(deviceDescriptorPlayer1) || descriptor.equals(deviceDescriptorPlayer2) @@ -426,23 +440,19 @@ public class InputFragment extends Fragment { return false; case 1: sharedPreferences.edit() - .putString("device_descriptor_player_1", descriptor) - .commit(); + .putString(Gamepad.pref_player1, descriptor).commit(); break; case 2: sharedPreferences.edit() - .putString("device_descriptor_player_2", descriptor) - .commit(); + .putString(Gamepad.pref_player2, descriptor).commit(); break; case 3: sharedPreferences.edit() - .putString("device_descriptor_player_3", descriptor) - .commit(); + .putString(Gamepad.pref_player3, descriptor).commit(); break; case 4: sharedPreferences.edit() - .putString("device_descriptor_player_4", descriptor) - .commit(); + .putString(Gamepad.pref_player4, descriptor).commit(); break; } @@ -459,56 +469,57 @@ public class InputFragment extends Fragment { private void removeController(int playerNum) { switch (playerNum) { case 1: - sharedPreferences.edit() - .putString("device_descriptor_player_1", null).commit(); + sharedPreferences.edit().putString(Gamepad.pref_player1, null) + .commit(); break; case 2: - sharedPreferences.edit() - .putString("device_descriptor_player_2", null).commit(); + sharedPreferences.edit().putString(Gamepad.pref_player2, null) + .commit(); break; case 3: - sharedPreferences.edit() - .putString("device_descriptor_player_3", null).commit(); + sharedPreferences.edit().putString(Gamepad.pref_player3, null) + .commit(); break; case 4: - sharedPreferences.edit() - .putString("device_descriptor_player_4", null).commit(); + sharedPreferences.edit().putString(Gamepad.pref_player4, null) + .commit(); break; } updateControllers(); } - - class MogaListener implements ControllerListener - { - + + class MogaListener implements ControllerListener { + private int playerNum; private String controllerId; - + public MogaListener(int playerNum) { this.playerNum = playerNum; } - + public void onKeyEvent(com.bda.controller.KeyEvent event) { controllerId = String.valueOf(event.getControllerId()); } public void onMotionEvent(MotionEvent arg0) { - + } - + public String getController() { return controllerId; } public void onStateEvent(StateEvent event) { - if (event.getState() == StateEvent.STATE_CONNECTION && event.getAction() == MOGAInput.ACTION_CONNECTED) { - int mControllerVersion = moga.mController.getState(Controller.STATE_CURRENT_PRODUCT_VERSION); - if (mControllerVersion == Controller.ACTION_VERSION_MOGAPRO) { - pad.isActiveMoga[playerNum] = true; - } else if (mControllerVersion == Controller.ACTION_VERSION_MOGA) { - pad.isActiveMoga[playerNum] = true; - } + if (event.getState() == StateEvent.STATE_CONNECTION + && event.getAction() == MOGAInput.ACTION_CONNECTED) { + int mControllerVersion = moga.mController + .getState(Controller.STATE_CURRENT_PRODUCT_VERSION); + if (mControllerVersion == Controller.ACTION_VERSION_MOGAPRO) { + pad.isActiveMoga[playerNum] = true; + } else if (mControllerVersion == Controller.ACTION_VERSION_MOGA) { + pad.isActiveMoga[playerNum] = true; + } } } } diff --git a/shell/android/src/com/reicast/emulator/config/InputModFragment.java b/shell/android/src/com/reicast/emulator/config/InputModFragment.java index 11f44b5fa..76a9ee396 100644 --- a/shell/android/src/com/reicast/emulator/config/InputModFragment.java +++ b/shell/android/src/com/reicast/emulator/config/InputModFragment.java @@ -61,7 +61,7 @@ public class InputModFragment extends Fragment { private TextView dpad_right_text; private TextView start_button_text; private TextView select_button_text; - + private String player = "_A"; private int sS = 2; private int playerNum = -1; @@ -104,8 +104,8 @@ public class InputModFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { mPrefs.edit() - .putBoolean("separate_joystick" + player, isChecked) - .commit(); + .putBoolean(Gamepad.pref_js_separate + player, + isChecked).commit(); } }; switchJoystickDpadEnabled = (Switch) getView().findViewById( @@ -116,8 +116,8 @@ public class InputModFragment extends Fragment { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { mPrefs.edit() - .putBoolean("modified_key_layout" + player, isChecked) - .commit(); + .putBoolean(Gamepad.pref_js_modified + player, + isChecked).commit(); } }; switchModifiedLayoutEnabled = (Switch) getView().findViewById( @@ -130,10 +130,10 @@ public class InputModFragment extends Fragment { if (isChecked) { selectController(); } else { - mPrefs.edit().remove("controller" + player).commit(); + mPrefs.edit().remove(Gamepad.pref_pad + player).commit(); } mPrefs.edit() - .putBoolean("controller_compat" + player, isChecked) + .putBoolean(Gamepad.pref_js_compat + player, isChecked) .commit(); } }; @@ -146,172 +146,163 @@ public class InputModFragment extends Fragment { ImageView a_button_icon = (ImageView) getView().findViewById( R.id.a_button_icon); a_button_icon.setImageDrawable(getButtonImage(448 / sS, 0)); - a_button_text = (TextView) getView().findViewById( - R.id.a_button_key); + a_button_text = (TextView) getView().findViewById(R.id.a_button_key); Button a_button = (Button) getView().findViewById(R.id.a_button_edit); a_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("a_button", a_button_text); + mKey.intiateSearch(Gamepad.pref_button_a, a_button_text); } }); Button a_remove = (Button) getView().findViewById(R.id.remove_a_button); a_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("a_button", a_button_text); + remKeyCode(Gamepad.pref_button_a, a_button_text); } }); ImageView b_button_icon = (ImageView) getView().findViewById( R.id.b_button_icon); b_button_icon.setImageDrawable(getButtonImage(384 / sS, 0)); - b_button_text = (TextView) getView().findViewById( - R.id.b_button_key); + b_button_text = (TextView) getView().findViewById(R.id.b_button_key); Button b_button = (Button) getView().findViewById(R.id.b_button_edit); b_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("b_button", b_button_text); + mKey.intiateSearch(Gamepad.pref_button_b, b_button_text); } }); Button b_remove = (Button) getView().findViewById(R.id.remove_b_button); b_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("b_button", b_button_text); + remKeyCode(Gamepad.pref_button_b, b_button_text); } }); ImageView x_button_icon = (ImageView) getView().findViewById( R.id.x_button_icon); x_button_icon.setImageDrawable(getButtonImage(256 / sS, 0)); - x_button_text = (TextView) getView().findViewById( - R.id.x_button_key); + x_button_text = (TextView) getView().findViewById(R.id.x_button_key); Button x_button = (Button) getView().findViewById(R.id.x_button_edit); x_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("x_button", x_button_text); + mKey.intiateSearch(Gamepad.pref_button_x, x_button_text); } }); Button x_remove = (Button) getView().findViewById(R.id.remove_x_button); x_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("x_button", x_button_text); + remKeyCode(Gamepad.pref_button_x, x_button_text); } }); ImageView y_button_icon = (ImageView) getView().findViewById( R.id.y_button_icon); y_button_icon.setImageDrawable(getButtonImage(320 / sS, 0)); - y_button_text = (TextView) getView().findViewById( - R.id.y_button_key); + y_button_text = (TextView) getView().findViewById(R.id.y_button_key); Button y_button = (Button) getView().findViewById(R.id.y_button_edit); y_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("y_button", y_button_text); + mKey.intiateSearch(Gamepad.pref_button_y, y_button_text); } }); Button y_remove = (Button) getView().findViewById(R.id.remove_y_button); y_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("y_button", y_button_text); + remKeyCode(Gamepad.pref_button_y, y_button_text); } }); ImageView l_button_icon = (ImageView) getView().findViewById( R.id.l_button_icon); l_button_icon.setImageDrawable(getButtonImage(78 / sS, 64 / sS)); - l_button_text = (TextView) getView().findViewById( - R.id.l_button_key); + l_button_text = (TextView) getView().findViewById(R.id.l_button_key); Button l_button = (Button) getView().findViewById(R.id.l_button_edit); l_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("l_button", l_button_text); + mKey.intiateSearch(Gamepad.pref_button_l, l_button_text); } }); Button l_remove = (Button) getView().findViewById(R.id.remove_l_button); l_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("l_button", l_button_text); + remKeyCode(Gamepad.pref_button_l, l_button_text); } }); ImageView r_button_icon = (ImageView) getView().findViewById( R.id.r_button_icon); r_button_icon.setImageDrawable(getButtonImage(162 / sS, 64 / sS)); - r_button_text = (TextView) getView().findViewById( - R.id.r_button_key); + r_button_text = (TextView) getView().findViewById(R.id.r_button_key); Button r_button = (Button) getView().findViewById(R.id.r_button_edit); r_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("r_button", r_button_text); + mKey.intiateSearch(Gamepad.pref_button_r, r_button_text); } }); Button r_remove = (Button) getView().findViewById(R.id.remove_r_button); r_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("r_button", r_button_text); + remKeyCode(Gamepad.pref_button_r, r_button_text); } }); - dpad_up_text = (TextView) getView().findViewById( - R.id.dpad_up_key); + dpad_up_text = (TextView) getView().findViewById(R.id.dpad_up_key); Button dpad_up = (Button) getView().findViewById(R.id.dpad_up_edit); dpad_up.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("dpad_up", dpad_up_text); + mKey.intiateSearch(Gamepad.pref_dpad_up, dpad_up_text); } }); Button up_remove = (Button) getView().findViewById(R.id.remove_dpad_up); up_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("dpad_up", dpad_up_text); + remKeyCode(Gamepad.pref_dpad_up, dpad_up_text); } }); - dpad_down_text = (TextView) getView().findViewById( - R.id.dpad_down_key); + dpad_down_text = (TextView) getView().findViewById(R.id.dpad_down_key); Button dpad_down = (Button) getView().findViewById(R.id.dpad_down_edit); dpad_down.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("dpad_down", dpad_down_text); + mKey.intiateSearch(Gamepad.pref_dpad_down, dpad_down_text); } }); Button down_remove = (Button) getView().findViewById( R.id.remove_dpad_down); down_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("dpad_down", dpad_down_text); + remKeyCode(Gamepad.pref_dpad_down, dpad_down_text); } }); - dpad_left_text = (TextView) getView().findViewById( - R.id.dpad_left_key); + dpad_left_text = (TextView) getView().findViewById(R.id.dpad_left_key); Button dpad_left = (Button) getView().findViewById(R.id.dpad_left_edit); dpad_left.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("dpad_left", dpad_left_text); + mKey.intiateSearch(Gamepad.pref_dpad_left, dpad_left_text); } }); Button left_remove = (Button) getView().findViewById( R.id.remove_dpad_left); left_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("dpad_left", dpad_left_text); + remKeyCode(Gamepad.pref_dpad_left, dpad_left_text); } }); - dpad_right_text = (TextView) getView().findViewById( - R.id.dpad_right_key); + dpad_right_text = (TextView) getView() + .findViewById(R.id.dpad_right_key); Button dpad_right = (Button) getView().findViewById( R.id.dpad_right_edit); dpad_right.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("dpad_right", dpad_right_text); + mKey.intiateSearch(Gamepad.pref_dpad_right, dpad_right_text); } }); Button right_remove = (Button) getView().findViewById( R.id.remove_dpad_right); right_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("dpad_right", dpad_right_text); + remKeyCode(Gamepad.pref_dpad_right, dpad_right_text); } }); @@ -324,14 +315,14 @@ public class InputModFragment extends Fragment { R.id.start_button_edit); start_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("start_button", start_button_text); + mKey.intiateSearch(Gamepad.pref_button_start, start_button_text); } }); Button start_remove = (Button) getView() .findViewById(R.id.remove_start); start_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("start_button", start_button_text); + remKeyCode(Gamepad.pref_button_start, start_button_text); } }); @@ -344,14 +335,15 @@ public class InputModFragment extends Fragment { R.id.select_button_edit); select_button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - mKey.intiateSearch("select_button", select_button_text); + mKey.intiateSearch(Gamepad.pref_button_select, + select_button_text); } }); - Button select_remove = (Button) getView() - .findViewById(R.id.remove_select); + Button select_remove = (Button) getView().findViewById( + R.id.remove_select); select_remove.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - remKeyCode("select_button", select_button_text); + remKeyCode(Gamepad.pref_button_select, select_button_text); } }); @@ -379,7 +371,7 @@ public class InputModFragment extends Fragment { } public void onNothingSelected(AdapterView arg0) { - + } }); @@ -389,8 +381,10 @@ public class InputModFragment extends Fragment { /** * Retrieve an image to serve as a visual representation * - * @param x The x start value of the image within the atlas - * @param y The y start value of the image within the atlas + * @param x + * The x start value of the image within the atlas + * @param y + * The y start value of the image within the atlas */ private Drawable getButtonImage(int x, int y) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { @@ -512,7 +506,8 @@ public class InputModFragment extends Fragment { /** * Assign the user button to the emulator button * - * @param keyCode The keycode generated by the button being assigned + * @param keyCode + * The keycode generated by the button being assigned * @param event * The keyevent generated by the button being assigned */ @@ -570,26 +565,26 @@ public class InputModFragment extends Fragment { return dispatchTouchEvent(ev); } } - + private void updateController(String player) { switchJoystickDpadEnabled.setChecked(mPrefs.getBoolean( - "separate_joystick" + player, false)); + Gamepad.pref_js_separate + player, false)); switchModifiedLayoutEnabled.setChecked(mPrefs.getBoolean( - "modified_key_layout" + player, false)); + Gamepad.pref_js_modified + player, false)); switchCompatibilityEnabled.setChecked(mPrefs.getBoolean( - "controller_compat" + player, false)); - getKeyCode("a_button", a_button_text); - getKeyCode("b_button", b_button_text); - getKeyCode("x_button", x_button_text); - getKeyCode("y_button", y_button_text); - getKeyCode("l_button", l_button_text); - getKeyCode("r_button", r_button_text); - getKeyCode("dpad_up", dpad_up_text); - getKeyCode("dpad_down", dpad_down_text); - getKeyCode("dpad_left", dpad_left_text); - getKeyCode("dpad_right", dpad_right_text); - getKeyCode("start_button", start_button_text); - getKeyCode("select_button", select_button_text); + Gamepad.pref_js_compat + player, false)); + getKeyCode(Gamepad.pref_button_a, a_button_text); + getKeyCode(Gamepad.pref_button_b, b_button_text); + getKeyCode(Gamepad.pref_button_x, x_button_text); + getKeyCode(Gamepad.pref_button_y, y_button_text); + getKeyCode(Gamepad.pref_button_l, l_button_text); + getKeyCode(Gamepad.pref_button_r, r_button_text); + getKeyCode(Gamepad.pref_dpad_up, dpad_up_text); + getKeyCode(Gamepad.pref_dpad_down, dpad_down_text); + getKeyCode(Gamepad.pref_dpad_left, dpad_left_text); + getKeyCode(Gamepad.pref_dpad_right, dpad_right_text); + getKeyCode(Gamepad.pref_button_start, start_button_text); + getKeyCode(Gamepad.pref_button_select, select_button_text); } private boolean getKeyCode(final String button, final TextView output) { diff --git a/shell/android/src/com/reicast/emulator/debug/GitAdapter.java b/shell/android/src/com/reicast/emulator/debug/GitAdapter.java index e53493444..49806f015 100644 --- a/shell/android/src/com/reicast/emulator/debug/GitAdapter.java +++ b/shell/android/src/com/reicast/emulator/debug/GitAdapter.java @@ -64,6 +64,7 @@ import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; import android.graphics.PorterDuff; import android.os.Build; import android.view.LayoutInflater; @@ -85,11 +86,12 @@ import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.nostra13.universalimageloader.core.assist.ImageScaleType; +import com.reicast.emulator.MainActivity; import com.reicast.emulator.R; public class GitAdapter extends BaseAdapter { - private Activity activity; + private static Activity activity; private ArrayList> data; private LayoutInflater inflater = null; private DisplayImageOptions options; @@ -168,7 +170,15 @@ public class GitAdapter extends BaseAdapter { return vi; } - public static void displayCommit(String title, String message, String url, + private static void callGithubVerification(String sha) { + String hash = sha.substring(0, 7); + Intent github = new Intent("com.reicast.emulator.debug.GitHash"); + github.setAction("reicast.emulator.GITHUB"); + github.putExtra("hashtag", hash); + activity.startActivity(github); + } + + public static void displayCommit(final String title, String message, String url, Context context) { final AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(true); @@ -186,6 +196,16 @@ public class GitAdapter extends BaseAdapter { return; } }); + if (MainActivity.debugUser) { + builder.setNegativeButton("Download", + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + callGithubVerification(title); + dialog.dismiss(); + return; + } + }); + } builder.create().show(); } diff --git a/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java b/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java index 146b98a1d..c117fd1da 100644 --- a/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java +++ b/shell/android/src/com/reicast/emulator/emu/GL2JNIView.java @@ -146,9 +146,9 @@ public class GL2JNIView extends GLSurfaceView ethd = new EmuThread(!Config.nosound); - touchVibrationEnabled = prefs.getBoolean("touch_vibration_enabled", true); + touchVibrationEnabled = prefs.getBoolean(Config.pref_touchvibe, true); - int renderType = prefs.getInt("render_type", LAYER_TYPE_HARDWARE); + int renderType = prefs.getInt(Config.pref_renderdepth, LAYER_TYPE_HARDWARE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { this.setLayerType(renderType, null); } else { @@ -189,7 +189,7 @@ public class GL2JNIView extends GLSurfaceView // is interpreted as any 32-bit surface with alpha by SurfaceFlinger. if(translucent) this.getHolder().setFormat(PixelFormat.TRANSLUCENT); - if (prefs.getBoolean("force_gpu", false)) { + if (prefs.getBoolean(Config.pref_forcegpu, false)) { setEGLContextFactory(new GLCFactory6.ContextFactory()); setEGLConfigChooser( translucent? diff --git a/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java b/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java index fe12522ee..179762a55 100644 --- a/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java +++ b/shell/android/src/com/reicast/emulator/emu/OnScreenMenu.java @@ -24,6 +24,7 @@ import com.reicast.emulator.GL2JNINative; import com.reicast.emulator.MainActivity; import com.reicast.emulator.R; import com.reicast.emulator.config.Config; +import com.reicast.emulator.periph.Gamepad; import com.reicast.emulator.periph.VmuLcd; public class OnScreenMenu { @@ -57,7 +58,7 @@ public class OnScreenMenu { popups = new Vector(); if (prefs != null) { this.prefs = prefs; - home_directory = prefs.getString("home_directory", home_directory); + home_directory = prefs.getString(Config.pref_home, home_directory); masteraudio = !Config.nosound; audio = masteraudio; } @@ -345,15 +346,15 @@ public class OnScreenMenu { ((GL2JNINative) mContext).mView.fastForward(false); } if (mContext instanceof GL2JNIActivity) { - ((GL2JNIActivity) mContext).mView.fastForward(false); + ((GL2JNIActivity) mContext).mView + .fastForward(false); } boosted = false; ((ImageButton) fastforward) .setImageResource(R.drawable.star); } else { if (mContext instanceof GL2JNINative) { - ((GL2JNINative) mContext).mView - .audioDisable(true); + ((GL2JNINative) mContext).mView.audioDisable(true); } if (mContext instanceof GL2JNIActivity) { ((GL2JNIActivity) mContext).mView @@ -376,11 +377,10 @@ public class OnScreenMenu { ((ImageButton) fastforward) .setImageResource(R.drawable.reset); } - } - }); + } + }); if (boosted) { - ((ImageButton) fastforward) - .setImageResource(R.drawable.reset); + ((ImageButton) fastforward).setImageResource(R.drawable.reset); } hlay.addView(fastforward, params); menuItems.add(fastforward); @@ -520,21 +520,24 @@ public class OnScreenMenu { rsticksetting = addbut(R.drawable.toggle_a_b, new OnClickListener() { public void onClick(View v) { - if (prefs.getBoolean("right_buttons", true)) { - prefs.edit().putBoolean("right_buttons", false) - .commit(); + if (prefs + .getBoolean(Gamepad.pref_js_rbuttons, true)) { + prefs.edit() + .putBoolean(Gamepad.pref_js_rbuttons, + false).commit(); ((ImageButton) rsticksetting) .setImageResource(R.drawable.toggle_a_b); } else { - prefs.edit().putBoolean("right_buttons", true) - .commit(); + prefs.edit() + .putBoolean(Gamepad.pref_js_rbuttons, + true).commit(); ((ImageButton) rsticksetting) .setImageResource(R.drawable.toggle_r_l); } dismiss(); } }); - if (prefs.getBoolean("right_buttons", true)) { + if (prefs.getBoolean(Gamepad.pref_js_rbuttons, true)) { ((ImageButton) rsticksetting) .setImageResource(R.drawable.toggle_r_l); } @@ -558,16 +561,18 @@ public class OnScreenMenu { hlay.addView(addbut(R.drawable.print_stats, new OnClickListener() { public void onClick(View v) { - //screenshot + // screenshot if (mContext instanceof GL2JNINative) { - ((GL2JNINative) OnScreenMenu.this.mContext).screenGrab(); + ((GL2JNINative) OnScreenMenu.this.mContext) + .screenGrab(); } if (mContext instanceof GL2JNIActivity) { - ((GL2JNIActivity) OnScreenMenu.this.mContext).screenGrab(); + ((GL2JNIActivity) OnScreenMenu.this.mContext) + .screenGrab(); } } }), params); - + hlay.addView(addbut(R.drawable.close, new OnClickListener() { public void onClick(View v) { Intent inte = new Intent(mContext, MainActivity.class); diff --git a/shell/android/src/com/reicast/emulator/periph/Gamepad.java b/shell/android/src/com/reicast/emulator/periph/Gamepad.java index a9f286317..c880badc0 100644 --- a/shell/android/src/com/reicast/emulator/periph/Gamepad.java +++ b/shell/android/src/com/reicast/emulator/periph/Gamepad.java @@ -15,6 +15,39 @@ import android.view.KeyEvent; public class Gamepad { + public static final String pref_player1 = "device_descriptor_player_1"; + public static final String pref_player2 = "device_descriptor_player_2"; + public static final String pref_player3 = "device_descriptor_player_3"; + public static final String pref_player4 = "device_descriptor_player_4"; + public static final String pref_pad = "controller"; + + public static final String pref_js_modified = "modified_key_layout"; + public static final String pref_js_compat = "controller_compat"; + public static final String pref_js_separate = "separate_joystick"; + public static final String pref_js_rbuttons = "right_buttons"; + + public static final String pref_button_a = "a_button"; + public static final String pref_button_b = "b_button"; + public static final String pref_button_x = "x_button"; + public static final String pref_button_y = "y_button"; + + public static final String pref_button_l = "l_button"; + public static final String pref_button_r = "r_button"; + + public static final String pref_dpad_up = "dpad_up"; + public static final String pref_dpad_down = "dpad_down"; + public static final String pref_dpad_left = "dpad_left"; + public static final String pref_dpad_right = "dpad_right"; + + public static final String pref_button_start = "start_button"; + public static final String pref_button_select = "select_button"; + + public static final String controllers_sony = "Sony PLAYSTATION(R)3 Controller"; + public static final String controllers_xbox = "Microsoft X-Box 360 pad"; + public static final String controllers_shield = "NVIDIA Corporation NVIDIA Controller"; + public static final String controllers_play = "keypad-zeus"; + public static final String controllers_play_gp = "keypad-game-zeus"; + public String[] portId = { "_A", "_B", "_C", "_D" }; public boolean[] compat = { false, false, false, false }; public boolean[] custom = { false, false, false, false }; @@ -122,18 +155,18 @@ public class Gamepad { public int[] setModifiedKeys(String id, int playerNum, SharedPreferences mPrefs) { return new int[] { - mPrefs.getInt("a_button" + id, OuyaController.BUTTON_O), key_CONT_A, - mPrefs.getInt("b_button" + id, OuyaController.BUTTON_A), key_CONT_B, - mPrefs.getInt("x_button" + id, OuyaController.BUTTON_U), key_CONT_X, - mPrefs.getInt("y_button" + id, OuyaController.BUTTON_Y), key_CONT_Y, + mPrefs.getInt(pref_button_a + id, OuyaController.BUTTON_O), key_CONT_A, + mPrefs.getInt(pref_button_b + id, OuyaController.BUTTON_A), key_CONT_B, + mPrefs.getInt(pref_button_x + id, OuyaController.BUTTON_U), key_CONT_X, + mPrefs.getInt(pref_button_y + id, OuyaController.BUTTON_Y), key_CONT_Y, - mPrefs.getInt("dpad_up" + id, OuyaController.BUTTON_DPAD_UP), key_CONT_DPAD_UP, - mPrefs.getInt("dpad_down" + id, OuyaController.BUTTON_DPAD_DOWN), key_CONT_DPAD_DOWN, - mPrefs.getInt("dpad_left" + id, OuyaController.BUTTON_DPAD_LEFT), key_CONT_DPAD_LEFT, - mPrefs.getInt("dpad_right" + id, OuyaController.BUTTON_DPAD_RIGHT), key_CONT_DPAD_RIGHT, + mPrefs.getInt(pref_dpad_up + id, OuyaController.BUTTON_DPAD_UP), key_CONT_DPAD_UP, + mPrefs.getInt(pref_dpad_down + id, OuyaController.BUTTON_DPAD_DOWN), key_CONT_DPAD_DOWN, + mPrefs.getInt(pref_dpad_left + id, OuyaController.BUTTON_DPAD_LEFT), key_CONT_DPAD_LEFT, + mPrefs.getInt(pref_dpad_right + id, OuyaController.BUTTON_DPAD_RIGHT), key_CONT_DPAD_RIGHT, - mPrefs.getInt("start_button" + id, getStartButtonCode()), key_CONT_START, - mPrefs.getInt("select_button" + id, getSelectButtonCode()), getSelectButtonCode() + mPrefs.getInt(pref_button_start + id, getStartButtonCode()), key_CONT_START, + mPrefs.getInt(pref_button_select + id, getSelectButtonCode()), getSelectButtonCode() }; } diff --git a/shell/debug/.settings/org.eclipse.jdt.core.prefs b/shell/debug/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..b080d2ddc --- /dev/null +++ b/shell/debug/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/shell/debug/AndroidManifest.xml b/shell/debug/AndroidManifest.xml index 57a016c4f..5937d82af 100644 --- a/shell/debug/AndroidManifest.xml +++ b/shell/debug/AndroidManifest.xml @@ -8,10 +8,12 @@ android:minSdkVersion="8" android:targetSdkVersion="18" /> + + + - + + + + + + + diff --git a/shell/debug/google/.classpath b/shell/debug/google/.classpath new file mode 100644 index 000000000..d57ec0251 --- /dev/null +++ b/shell/debug/google/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/shell/debug/google/.project b/shell/debug/google/.project new file mode 100644 index 000000000..4fe5b786d --- /dev/null +++ b/shell/debug/google/.project @@ -0,0 +1,33 @@ + + + google-services + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/shell/debug/google/.settings/org.eclipse.jdt.core.prefs b/shell/debug/google/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..b080d2ddc --- /dev/null +++ b/shell/debug/google/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/shell/debug/google/AndroidManifest.xml b/shell/debug/google/AndroidManifest.xml new file mode 100644 index 000000000..2e6aa673e --- /dev/null +++ b/shell/debug/google/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/shell/debug/google/README.txt b/shell/debug/google/README.txt new file mode 100644 index 000000000..cf6f1859e --- /dev/null +++ b/shell/debug/google/README.txt @@ -0,0 +1,14 @@ +Library Project including Google Play services client jar. + +This can be used by an Android project to use the API's provided +by Google Play services. + +There is technically no source, but the src folder is necessary +to ensure that the build system works. The content is actually +located in the libs/ directory. + + +USAGE: + +Make sure you import this Android library project into your IDE +and set this project as a dependency. diff --git a/shell/debug/google/build.xml b/shell/debug/google/build.xml new file mode 100644 index 000000000..1ad5c938b --- /dev/null +++ b/shell/debug/google/build.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shell/debug/google/libs/google-play-services.jar b/shell/debug/google/libs/google-play-services.jar new file mode 100644 index 000000000..7839fe301 Binary files /dev/null and b/shell/debug/google/libs/google-play-services.jar differ diff --git a/shell/debug/google/libs/google-play-services.jar.properties b/shell/debug/google/libs/google-play-services.jar.properties new file mode 100644 index 000000000..429687b79 --- /dev/null +++ b/shell/debug/google/libs/google-play-services.jar.properties @@ -0,0 +1 @@ +doc=../../../docs/reference diff --git a/shell/debug/google/project.properties b/shell/debug/google/project.properties new file mode 100644 index 000000000..b3b1d5a81 --- /dev/null +++ b/shell/debug/google/project.properties @@ -0,0 +1,15 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-9 +android.library=true diff --git a/shell/debug/google/res/color/common_signin_btn_text_dark.xml b/shell/debug/google/res/color/common_signin_btn_text_dark.xml new file mode 100644 index 000000000..a615ba274 --- /dev/null +++ b/shell/debug/google/res/color/common_signin_btn_text_dark.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/shell/debug/google/res/color/common_signin_btn_text_light.xml b/shell/debug/google/res/color/common_signin_btn_text_light.xml new file mode 100644 index 000000000..662066899 --- /dev/null +++ b/shell/debug/google/res/color/common_signin_btn_text_light.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.png new file mode 100644 index 000000000..0f9e7917e Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.png new file mode 100644 index 000000000..570e43225 Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.png new file mode 100644 index 000000000..570e43225 Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.png new file mode 100644 index 000000000..0f9e7917e Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.png new file mode 100644 index 000000000..f507b9f7d Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.png new file mode 100644 index 000000000..d5625e5fc Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.png new file mode 100644 index 000000000..aea3c0d16 Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.png new file mode 100644 index 000000000..849e89f3a Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.png new file mode 100644 index 000000000..f4ab2f2a5 Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.png new file mode 100644 index 000000000..9fe611d68 Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.png new file mode 100644 index 000000000..bbcde39cf Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.png new file mode 100644 index 000000000..53957b698 Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.png new file mode 100644 index 000000000..53957b698 Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.png new file mode 100644 index 000000000..bbcde39cf Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.png new file mode 100644 index 000000000..000d12e8e Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png new file mode 100644 index 000000000..d9279405c Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.png new file mode 100644 index 000000000..67f263c80 Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_normal_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_normal_light.9.png new file mode 100644 index 000000000..96324c52f Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_normal_light.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.png new file mode 100644 index 000000000..e4503128f Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.png differ diff --git a/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.png b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.png new file mode 100644 index 000000000..fb94b7761 Binary files /dev/null and b/shell/debug/google/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.png new file mode 100644 index 000000000..dddcbebf1 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.png new file mode 100644 index 000000000..58b75bd7d Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.png new file mode 100644 index 000000000..58b75bd7d Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.png new file mode 100644 index 000000000..dddcbebf1 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.png new file mode 100644 index 000000000..7d9ed7834 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.png new file mode 100644 index 000000000..0ca401d37 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.png new file mode 100644 index 000000000..f2c3f5571 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.png new file mode 100644 index 000000000..83b4fc9d6 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.png new file mode 100644 index 000000000..dd74fe876 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.png new file mode 100644 index 000000000..b7dc7aac7 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.png new file mode 100644 index 000000000..efdfe2e61 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.png new file mode 100644 index 000000000..c7650b09e Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.png new file mode 100644 index 000000000..c7650b09e Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.png new file mode 100644 index 000000000..efdfe2e61 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.png new file mode 100644 index 000000000..8c76283e5 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_focus_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_focus_light.9.png new file mode 100644 index 000000000..abd26bcd4 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.png new file mode 100644 index 000000000..28181c338 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_normal_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_normal_light.9.png new file mode 100644 index 000000000..34957fad5 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_normal_light.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.png new file mode 100644 index 000000000..e923ee9c7 Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.png differ diff --git a/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.png b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.png new file mode 100644 index 000000000..34cf6bbad Binary files /dev/null and b/shell/debug/google/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.png new file mode 100644 index 000000000..9044a118a Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.png new file mode 100644 index 000000000..e94a49b0a Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.png new file mode 100644 index 000000000..e94a49b0a Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.png new file mode 100644 index 000000000..9044a118a Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.png new file mode 100644 index 000000000..bfe4f0463 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.png new file mode 100644 index 000000000..876884fad Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.png new file mode 100644 index 000000000..b3e6dd5b4 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.png new file mode 100644 index 000000000..5a888f28f Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.png new file mode 100644 index 000000000..d0f7b4cbf Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.png new file mode 100644 index 000000000..0db6b0645 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.png new file mode 100644 index 000000000..d182b5e2c Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.png new file mode 100644 index 000000000..47e2aeaf3 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.png new file mode 100644 index 000000000..47e2aeaf3 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.png new file mode 100644 index 000000000..d182b5e2c Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.png new file mode 100644 index 000000000..64e970687 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.png new file mode 100644 index 000000000..0fd8cdda1 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.png new file mode 100644 index 000000000..3427b4768 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.png new file mode 100644 index 000000000..31e38c4c1 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.png new file mode 100644 index 000000000..e6a788073 Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.png differ diff --git a/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.png b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.png new file mode 100644 index 000000000..972962dcf Binary files /dev/null and b/shell/debug/google/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.png differ diff --git a/shell/debug/google/res/drawable/common_signin_btn_icon_dark.xml b/shell/debug/google/res/drawable/common_signin_btn_icon_dark.xml new file mode 100644 index 000000000..dd1cf679f --- /dev/null +++ b/shell/debug/google/res/drawable/common_signin_btn_icon_dark.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/shell/debug/google/res/drawable/common_signin_btn_icon_light.xml b/shell/debug/google/res/drawable/common_signin_btn_icon_light.xml new file mode 100644 index 000000000..abf412bda --- /dev/null +++ b/shell/debug/google/res/drawable/common_signin_btn_icon_light.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/shell/debug/google/res/drawable/common_signin_btn_text_dark.xml b/shell/debug/google/res/drawable/common_signin_btn_text_dark.xml new file mode 100644 index 000000000..2d92217cd --- /dev/null +++ b/shell/debug/google/res/drawable/common_signin_btn_text_dark.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/shell/debug/google/res/drawable/common_signin_btn_text_light.xml b/shell/debug/google/res/drawable/common_signin_btn_text_light.xml new file mode 100644 index 000000000..810c02112 --- /dev/null +++ b/shell/debug/google/res/drawable/common_signin_btn_text_light.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/shell/debug/google/res/values-af/strings.xml b/shell/debug/google/res/values-af/strings.xml new file mode 100644 index 000000000..451db371f --- /dev/null +++ b/shell/debug/google/res/values-af/strings.xml @@ -0,0 +1,19 @@ + + + "Kry Google Play-dienste" + "Hierdie program sal nie loop sonder Google Play-dienste nie, wat nie op jou foon is nie." + "Hierdie program sal nie loop sonder Google Play-dienste nie, wat nie op jou tablet is nie." + "Kry Google Play-dienste" + "Aktiveer Google Play-dienste" + "Hierdie program sal nie werk tensy jy Google Play-dienste aktiveer nie." + "Aktiveer Google Play-dienste" + "Dateer Google Play-dienste op" + "Hierdie program sal nie loop nie, tensy jy Google Play-dienste opdateer." + "Onbekende probleem met Google Play-dienste." + "Google Play-dienste" + "Google Play-dienste, waarop sommige van jou programme staatmaak, werk nie met jou toestel nie. Kontak asseblief die vervaardiger vir bystand." + "Dateer op" + "Meld aan" + "Meld aan met Google" + diff --git a/shell/debug/google/res/values-am/strings.xml b/shell/debug/google/res/values-am/strings.xml new file mode 100644 index 000000000..7386ef3e0 --- /dev/null +++ b/shell/debug/google/res/values-am/strings.xml @@ -0,0 +1,19 @@ + + + "Google Play አገልግሎቶችን አግኝ" + "ይህ መተግበሪያ ያለ Google Play አገልግሎቶች አይሰራም፣ እነሱ ደግሞ ስልክዎ ላይ የሉም።" + "ይህ መተግበሪያ ያለ Google Play አገልግሎቶች አይሰራም፣ እነሱ ደግሞ ጡባዊዎ ላይ የሉም።" + "Google Play አገልግሎቶችን አግኝ" + "Google Play አገልግሎቶችን አንቃ" + "Google Play አገልግሎቶችን እስካላነቁ ድረስ ይህ መተግበሪያ አይሰራም።" + "Google Play አገልግሎቶችን አንቃ" + "Google Play አገልግሎቶችን ያዘምኑ" + "Google Play አገልግሎቶችን እስኪያዘምኑ ድረስ ይህ መተግበሪያ አይሰራም።" + "በGoogle Play አገልግሎቶች ላይ ያልታወቀ ችግር።" + "Google Play አገልግሎቶች" + "የGoogle Play አገልግሎቶች፣ አንዳንድ መተግበሪያዎችዎ በእሱ ላይ ጥገኛ የሆኑት፣ በመሣሪያዎ አይደገፍም። እባክዎ ለእርዳታ አምራቹን ያግኙ።" + "ያዘምኑ" + "ግባ" + "በGoogle ይግቡ" + diff --git a/shell/debug/google/res/values-ar/strings.xml b/shell/debug/google/res/values-ar/strings.xml new file mode 100644 index 000000000..97b83e732 --- /dev/null +++ b/shell/debug/google/res/values-ar/strings.xml @@ -0,0 +1,19 @@ + + + "الحصول على خدمات Google Play" + "لن يتم تشغيل هذا التطبيق بدون خدمات Google Play، والتي لا تتوفر في هاتفك." + "لن يتم تشغيل هذا التطبيق بدون خدمات Google Play، والتي لا تتوفر في جهازك اللوحي." + "الحصول على خدمات Google Play" + "تمكين خدمات Google Play" + "لن يعمل هذا التطبيق ما لم يتم تمكين خدمات Google Play." + "تمكين خدمات Google Play" + "تحديث خدمات Google Play" + "لن يتم تشغيل هذا التطبيق ما لم تحدِّث خدمات Google Play." + "حدثت مشكلة غير معروفة في خدمات Google Play." + "خدمات Google Play" + "خدمات Google Play التي تستجيب لها بعض تطبيقاتك لا تعمل على جهازك. يُرجى الاتصال بجهة التصنيع للحصول على المساعدة." + "تحديث" + "تسجيل الدخول" + "تسجيل الدخول باستخدام Google" + diff --git a/shell/debug/google/res/values-be/strings.xml b/shell/debug/google/res/values-be/strings.xml new file mode 100644 index 000000000..56cb75e20 --- /dev/null +++ b/shell/debug/google/res/values-be/strings.xml @@ -0,0 +1,19 @@ + + + "Атрымаць службы Google Play" + "Гэта прыкладанне не будзе працаваць без службаў Google Play, якіх няма ў вашым тэлефоне." + "Гэта прыкладанне не будзе працаваць без службаў Google Play, якіх няма на вашым планшэце." + "Атрымаць службы Google Play" + "Уключыць службы Google Play" + "Гэта прыкладанне не будзе працаваць, пакуль вы не ўключыце службы Google Play." + "Уключыць службы Google Play" + "Абнаўленне службаў Google Play" + "Гэта прыкладанне не будзе працаваць падчас абнаўлення службаў Google Play." + "Невядомая праблема са службамі Google Play." + "Службы Google Play" + "Службы Google Play, да якiх прывязаны некаторыя прыкладаннi, не падтрымлiваюцца на вашай прыладзе. Па дапамогу звярнiцеся да вытворцы." + "Абнавіць" + "Увайсцi" + "Увайсці ў Google" + diff --git a/shell/debug/google/res/values-bg/strings.xml b/shell/debug/google/res/values-bg/strings.xml new file mode 100644 index 000000000..2fa9f0c3c --- /dev/null +++ b/shell/debug/google/res/values-bg/strings.xml @@ -0,0 +1,19 @@ + + + "Изтегляне на услугите за Google Play" + "Това приложение няма да се изпълнява без услугите за Google Play, които липсват в телефона ви." + "Това приложение няма да се изпълнява без услугите за Google Play, които липсват в таблета ви." + "Услуги за Google Play: Изтегл." + "Активиране на услугите за Google Play" + "Това приложение няма да работи, освен ако не активирате услугите за Google Play." + "Услуги за Google Play: Актив." + "Актуализиране на услугите за Google Play" + "Това приложение няма да се изпълнява, освен ако не актуализирате услугите за Google Play." + "Неизвестен проблем с услугите за Google Play." + "Услуги за Google Play" + "Услугите за Google Play, на които разчитат някои от приложенията ви, не се поддържат от устройството ви. Моля, свържете се с производителя за помощ." + "Актуализиране" + "Вход" + "Вход с Google" + diff --git a/shell/debug/google/res/values-ca/strings.xml b/shell/debug/google/res/values-ca/strings.xml new file mode 100644 index 000000000..ce6536ea3 --- /dev/null +++ b/shell/debug/google/res/values-ca/strings.xml @@ -0,0 +1,19 @@ + + + "Baixa els serveis de Google Play" + "Aquesta aplicació no s\'executarà si el telèfon no té instal·lats els serveis de Google Play." + "Aquesta aplicació no funcionarà si la tauleta no té instal·lats els serveis de Google Play." + "Baixa els serveis de Google Play" + "Activa els serveis de Google Play" + "Aquesta aplicació no funcionarà si no actives els serveis de Google Play." + "Activa els serveis de Google Play" + "Actualitza els serveis de Google Play" + "Aquesta aplicació no s\'executarà si no actualitzes els serveis de Google Play." + "Error desconegut relacionat amb els serveis de Google Play." + "Serveis de Google Play" + "El teu dispositiu no és compatible amb els serveis de Google Play, en què es basen les teves aplicacions. Per obtenir assistència, contacta amb el fabricant." + "Actualitza" + "Inicia sessió" + "Inicia sessió amb Google" + diff --git a/shell/debug/google/res/values-cs/strings.xml b/shell/debug/google/res/values-cs/strings.xml new file mode 100644 index 000000000..4d3ae366b --- /dev/null +++ b/shell/debug/google/res/values-cs/strings.xml @@ -0,0 +1,19 @@ + + + "Instalovat služby Google Play" + "Ke spuštění této aplikace jsou potřeba služby Google Play, které v telefonu nemáte." + "Ke spuštění této aplikace jsou potřeba služby Google Play, které v tabletu nemáte." + "Instalovat služby Google Play" + "Aktivovat služby Google Play" + "Ke spuštění této aplikace je třeba aktivovat služby Google Play." + "Aktivovat služby Google Play" + "Aktualizace služeb Google Play" + "Ke spuštění této aplikace je třeba aktualizovat služby Google Play." + "Nastal neznámý problém se službami Google Play." + "Služby Google Play" + "Některé vaše aplikace vyžadují služby Google Play, které ve vašem zařízení nejsou podporovány. S žádostí o pomoc se prosím obraťte na výrobce." + "Aktualizovat" + "Přihlásit se" + "Přihlásit se účtem Google" + diff --git a/shell/debug/google/res/values-da/strings.xml b/shell/debug/google/res/values-da/strings.xml new file mode 100644 index 000000000..f6a802753 --- /dev/null +++ b/shell/debug/google/res/values-da/strings.xml @@ -0,0 +1,19 @@ + + + "Hent Google Play-tjenester" + "Denne app kan ikke køre uden Google Play-tjenester, som mangler på din telefon." + "Denne app kan ikke køre uden Google Play-tjenester, som mangler på din tablet." + "Hent Google Play-tjenester" + "Aktivér Google Play-tjenester" + "Denne app virker ikke, medmindre du aktiverer Google Play-tjenester." + "Aktivér Google Play-tjenester" + "Opdater Google Play-tjenester" + "Denne app kan ikke køre, medmindre du opdaterer Google Play-tjenester." + "Ukendt problem med Google Play-tjenester." + "Google Play-tjenester" + "Google Play-tjenester, som nogle af dine applikationer er afhængige af, understøttes ikke af din enhed. Kontakt producenten for at få hjælp." + "Opdater" + "Log ind" + "Log ind med Google" + diff --git a/shell/debug/google/res/values-de/strings.xml b/shell/debug/google/res/values-de/strings.xml new file mode 100644 index 000000000..0185914fa --- /dev/null +++ b/shell/debug/google/res/values-de/strings.xml @@ -0,0 +1,19 @@ + + + "Google Play-Dienste installieren" + "Zur Nutzung dieser App sind Google Play-Dienste erforderlich, die auf Ihrem Telefon nicht installiert sind." + "Zur Nutzung dieser App sind Google Play-Dienste erforderlich, die auf Ihrem Tablet nicht installiert sind." + "Google Play-Dienste installieren" + "Google Play-Dienste aktivieren" + "Diese App funktioniert nur, wenn Sie die Google Play-Dienste aktivieren." + "Google Play-Dienste aktivieren" + "Google Play-Dienste aktualisieren" + "Diese App wird nur ausgeführt, wenn Sie die Google Play-Dienste aktualisieren." + "Unbekanntes Problem mit Google Play-Diensten" + "Google Play-Dienste" + "Google Play-Dienste, auf denen einige Ihrer Apps basieren, werden von diesem Gerät nicht unterstützt. Wenden Sie sich für weitere Informationen an den Hersteller." + "Aktualisieren" + "Anmelden" + "Über Google anmelden" + diff --git a/shell/debug/google/res/values-el/strings.xml b/shell/debug/google/res/values-el/strings.xml new file mode 100644 index 000000000..bef88b3b7 --- /dev/null +++ b/shell/debug/google/res/values-el/strings.xml @@ -0,0 +1,19 @@ + + + "Λήψη υπηρεσιών Google Play" + "Αυτή η εφαρμογή δεν θα εκτελεστεί χωρίς τις υπηρεσίες Google Play, οι οποίες λείπουν από το τηλέφωνό σας." + "Αυτή η εφαρμογή δεν θα εκτελεστεί χωρίς τις υπηρεσίες Google Play, οι οποίες λείπουν από το tablet σας." + "Λήψη υπηρεσιών Google Play" + "Ενεργοποίηση υπηρεσιών Google Play" + "Αυτή η εφαρμογή δεν θα λειτουργήσει εάν δεν έχετε ενεργοποιήσει τις υπηρεσίες Google Play." + "Ενεργοπ. υπηρεσιών Google Play" + "Ενημέρωση υπηρεσιών Google Play" + "Αυτή η εφαρμογή θα εκτελεστεί αφού ενημερώσετε τις υπηρεσίες Google Play." + "Άγνωστο πρόβλημα με τις υπηρεσίες Google Play." + "Υπηρεσίες Google Play" + "Οι υπηρεσίες Google Play, στις οποίες βασίζονται ορισμένες από τις εφαρμογές σας, δεν υποστηρίζονται στη συσκευή σας. Επικοινωνήστε με τον κατασκευαστή για υποστήριξη." + "Ενημέρωση" + "Σύνδεση" + "Συνδεθείτε στο Google" + diff --git a/shell/debug/google/res/values-en-rGB/strings.xml b/shell/debug/google/res/values-en-rGB/strings.xml new file mode 100644 index 000000000..055dab34c --- /dev/null +++ b/shell/debug/google/res/values-en-rGB/strings.xml @@ -0,0 +1,19 @@ + + + "Get Google Play services" + "This app won\'t run without Google Play services, which are missing from your phone." + "This app won\'t run without Google Play services, which are missing from your tablet." + "Get Google Play services" + "Enable Google Play services" + "This app won\'t work unless you enable Google Play services." + "Enable Google Play services" + "Update Google Play services" + "This app won\'t run unless you update Google Play services." + "Unknown issue with Google Play services." + "Google Play services" + "Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance." + "Update" + "Sign in" + "Sign in with Google" + diff --git a/shell/debug/google/res/values-es-rUS/strings.xml b/shell/debug/google/res/values-es-rUS/strings.xml new file mode 100644 index 000000000..14f89f470 --- /dev/null +++ b/shell/debug/google/res/values-es-rUS/strings.xml @@ -0,0 +1,19 @@ + + + "Obtener Google Play Services" + "Esta aplicación no se ejecutará si no instalasGoogle Play Services en tu dispositivo." + "Esta aplicación no se ejecutará si no instalas Google Play Services en tu tableta." + "Descargar Google Play Services" + "Activar Google Play Services" + "Esta aplicación no funcionará si no activas Google Play Services." + "Activar Google Play Services" + "Actualizar Google Play Services" + "Esta aplicación no se ejecutará si no actualizas Google Play Services." + "Error desconocido relacionado con Google Play Services" + "Google Play Services" + "Google Play Services, del cual dependen algunas de tus aplicaciones, no es compatible con tu dispositivo. Comunícate con el fabricante para obtener ayuda." + "Actualizar" + "Acceder" + "Acceder con Google" + diff --git a/shell/debug/google/res/values-es/strings.xml b/shell/debug/google/res/values-es/strings.xml new file mode 100644 index 000000000..96e7ee9ca --- /dev/null +++ b/shell/debug/google/res/values-es/strings.xml @@ -0,0 +1,19 @@ + + + "Descargar servicios de Google Play" + "Esta aplicación no se ejecutará si tu teléfono no tiene instalados los servicios de Google Play." + "Esta aplicación no se ejecutará si tu tablet no tiene instalados los servicios de Google Play." + "Descargar servicios de Google Play" + "Habilitar servicios de Google Play" + "Esta aplicación no funcionará si no habilitas los servicios de Google Play." + "Habilitar servicios de Google Play" + "Actualizar servicios de Google Play" + "Esta aplicación no se ejecutará si no actualizas los servicios de Google Play." + "Error desconocido relacionado con los servicios de Google Play" + "Servicios de Google Play" + "Tu dispositivo no es compatible con los servicios de Google Play, de los cuales dependen tus aplicaciones. Para obtener asistencia, ponte en contacto el fabricante." + "Actualizar" + "Iniciar sesión" + "Iniciar sesión con Google" + diff --git a/shell/debug/google/res/values-et/strings.xml b/shell/debug/google/res/values-et/strings.xml new file mode 100644 index 000000000..e7043e6b3 --- /dev/null +++ b/shell/debug/google/res/values-et/strings.xml @@ -0,0 +1,19 @@ + + + "Hankige Google Play teenused" + "Selle rakenduse käitamiseks on vaja Google Play teenuseid, mida teie telefonis pole." + "Selle rakenduse käitamiseks on vaja Google Play teenuseid, mida teie tahvelarvutis pole." + "Hankige Google Play teenused" + "Lubage Google Play teenused" + "See rakendus ei tööta, kui te ei luba Google Play teenuseid." + "Lubage Google Play teenused" + "Värskendage Google Play teenuseid" + "Seda rakendust ei saa käitada, kui te ei värskenda Google Play teenuseid." + "Google Play teenuste tundmatu probleem." + "Google Play teenused" + "Teie seade ei toeta Google Play teenuseid, millele mõni teie rakendustest toetub. Abi saamiseks võtke ühendust tootjaga." + "Värskenda" + "Logi sisse" + "Logi sisse Google\'iga" + diff --git a/shell/debug/google/res/values-fa/strings.xml b/shell/debug/google/res/values-fa/strings.xml new file mode 100644 index 000000000..6047bf36e --- /dev/null +++ b/shell/debug/google/res/values-fa/strings.xml @@ -0,0 +1,19 @@ + + + "دریافت خدمات Google Play" + "این برنامه بدون خدمات Google Play اجرا نمی‌شود، این خدمات در تلفن شما وجود ندارد." + "این برنامه بدون خدمات Google Play اجرا نمی‌شود، این خدمات در رایانهٔ لوحی شما وجود ندارد." + "دریافت خدمات Google Play" + "فعال کردن خدمات Google Play" + "تا زمانی‌که خدمات Google Play را فعال نکنید این برنامه کار نمی‌کند." + "فعال کردن خدمات Google Play" + "به‌روزرسانی خدمات Google Play" + "تا زمانی‌که خدمات Google Play را به‌روز نکنید این برنامه کار نمی‌کند." + "مشکل نامشخص در خدمات Google Play." + "خدمات Google Play" + "خدمات Google Play، که برخی از برنامه‌های شما به آن وابسته است، توسط دستگاه شما پشتیبانی نمی‌شود. لطفاً برای دریافت کمک با سازنده تماس بگیرید." + "به‌روزرسانی" + "ورود به سیستم" + "ورود به سیستم با Google‎" + diff --git a/shell/debug/google/res/values-fi/strings.xml b/shell/debug/google/res/values-fi/strings.xml new file mode 100644 index 000000000..76cdbb78b --- /dev/null +++ b/shell/debug/google/res/values-fi/strings.xml @@ -0,0 +1,19 @@ + + + "Asenna Google Play -palvelut" + "Tämä sovellus ei toimi ilman Google Play -palveluita, jotka puuttuvat puhelimesta." + "Tämä sovellus ei toimi ilman Google Play -palveluita, jotka puuttuvat tablet-laitteesta." + "Asenna Google Play -palvelut" + "Ota Google Play -palvelut käyttöön" + "Tämä sovellus ei toimi, ellet ota Google Play -palveluita käyttöön." + "Ota Google Play -palv. käyttöön" + "Päivitä Google Play -palvelut" + "Tämä sovellus ei toimi, ellet päivitä Google Play -palveluita." + "Tuntematon ongelma käytettäessä Google Play -palveluita." + "Google Play -palvelut" + "Google Play -palveluita, joita osa sovelluksistasi käyttää, ei tueta laitteellasi. Pyydä ohjeita laitteen valmistajalta." + "Päivitä" + "Kirjaudu" + "Kirjaudu Google-tiliin" + diff --git a/shell/debug/google/res/values-fr/strings.xml b/shell/debug/google/res/values-fr/strings.xml new file mode 100644 index 000000000..9d93f55a6 --- /dev/null +++ b/shell/debug/google/res/values-fr/strings.xml @@ -0,0 +1,19 @@ + + + "Installer les services Google Play" + "Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre téléphone." + "Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre tablette." + "Installer services Google Play" + "Activer les services Google Play" + "Cette application ne fonctionnera pas tant que vous n\'aurez pas activé les services Google Play." + "Activer services Google Play" + "Mettre à jour les services Google Play" + "Cette application ne fonctionnera pas tant que vous n\'aurez pas mis à jour les services Google Play." + "Problème inconnu avec les services Google Play." + "Services Google Play" + "Les services Google Play, dont dépendent certaines de vos applications, ne sont pas compatibles avec votre appareil. Veuillez contacter le fabricant pour obtenir de l\'aide." + "Mettre à jour" + "Connexion" + "Se connecter avec Google" + diff --git a/shell/debug/google/res/values-hi/strings.xml b/shell/debug/google/res/values-hi/strings.xml new file mode 100644 index 000000000..9bdad37d0 --- /dev/null +++ b/shell/debug/google/res/values-hi/strings.xml @@ -0,0 +1,19 @@ + + + "Google Play सेवाएं पाएं" + "यह एप्लिकेशन Google Play सेवाओं के बिना नहीं चलेगा, जो आपके फ़ोन में नहीं हैं." + "यह एप्लिकेशन Google Play सेवाओं के बिना नहीं चलेगा, जो आपके टेबलेट में नहीं हैं." + "Google Play सेवाएं पाएं" + "Google Play सेवाएं सक्षम करें" + "जब तक आप Google Play सेवाएं सक्षम नहीं करते, तब तक यह एप्लिकेशन कार्य नहीं करेगा." + "Google Play सेवाएं सक्षम करें" + "Google Play सेवाएं अपडेट करें" + "जब तक आप Google Play सेवाओं को अपडेट नहीं करते, तब तक यह एप्लिकेशन नहीं चलेगा." + "Google Play सेवाओं के साथ अज्ञात समस्या." + "Google Play सेवाएं" + "Google Play सेवाएं, जिन पर आपके कुछ एप्लिकेशन निर्भर करते हैं, आपके उपकरण द्वारा समर्थित नहीं हैं. कृपया सहायता के लिए निर्माता से संपर्क करें." + "अपडेट करें" + "साइन इन करें" + "Google से साइन इन करें" + diff --git a/shell/debug/google/res/values-hr/strings.xml b/shell/debug/google/res/values-hr/strings.xml new file mode 100644 index 000000000..beb0276dd --- /dev/null +++ b/shell/debug/google/res/values-hr/strings.xml @@ -0,0 +1,19 @@ + + + "Preuzmi usluge za Google Play" + "Ova aplikacija neće funkcionirati bez usluga za Google Play, koje nisu instalirane na vašem telefonu." + "Ova aplikacija neće funkcionirati bez usluga za Google Play, koje nisu instalirane na vašem tabletnom računalu." + "Preuzmi usluge za Google Play" + "Omogući usluge za Google Play" + "Ova aplikacija neće raditi ako ne omogućite usluge za Google Play." + "Omogući usluge za Google Play" + "Ažuriraj usluge za Google Play" + "Ova se aplikacija neće pokrenuti ako ne ažurirate usluge za Google Play." + "Nepoznata poteškoća s uslugama za Google Play." + "Usluge za Google Play" + "Usluge za Google Play, koje su potrebne za funkcioniranje nekih vaših aplikacija, nisu podržane na vašem uređaju. Pomoć potražite od proizvođača." + "Ažuriranje" + "Prijava" + "Prijava uslugom Google" + diff --git a/shell/debug/google/res/values-hu/strings.xml b/shell/debug/google/res/values-hu/strings.xml new file mode 100644 index 000000000..b36848190 --- /dev/null +++ b/shell/debug/google/res/values-hu/strings.xml @@ -0,0 +1,19 @@ + + + "Play Szolgáltatások telepítése" + "Az alkalmazás működéséhez a Google Play Szolgáltatások szükségesek, ezek nincsenek telepítve a telefonon." + "Az alkalmazás működéséhez a Google Play Szolgáltatások szükségesek, ezek nincsenek telepítve a táblagépen." + "Play Szolgáltatások telepítése" + "Google Play Szolgáltatások aktiválása" + "Az alkalmazás csak akkor fog működni, ha engedélyezi a Google Play Szolgáltatásokat." + "Play Szolgáltatások aktiválása" + "Play Szolgáltatások frissítése" + "Az alkalmazás csak akkor fog működni, ha frissíti a Google Play Szolgáltatásokat." + "Ismeretlen hiba a Google Play Szolgáltatásokban." + "Google Play Szolgáltatások" + "A Google Play Szolgáltatásokat, amelyre egyes alkalmazások támaszkodnak, nem támogatja az eszköz. Segítségért forduljon az eszköz gyártójához." + "Frissítés" + "Belépés" + "Google-bejelentkezés" + diff --git a/shell/debug/google/res/values-in/strings.xml b/shell/debug/google/res/values-in/strings.xml new file mode 100644 index 000000000..d66d76cac --- /dev/null +++ b/shell/debug/google/res/values-in/strings.xml @@ -0,0 +1,19 @@ + + + "Dapatkan layanan Google Play" + "Aplikasi ini tidak akan berjalan tanpa layanan Google Play, yang tidak ada di ponsel Anda." + "Aplikasi ini tidak akan berjalan tanpa layanan Google Play, yang tidak ada di tablet Anda." + "Dapatkan layanan Google Play" + "Aktifkan layanan Google Play" + "Aplikasi ini tidak akan bekerja sampai Anda mengaktifkan layanan Google Play." + "Aktifkan layanan Google Play" + "Perbarui layanan Google Play" + "Aplikasi ini tidak akan berjalan sampai Anda memperbarui layanan Google Play." + "Masalah tidak diketahui pada layanan Google Play." + "Layanan Google Play" + "Layanan Google Play, yang diandalkan oleh beberapa aplikasi Anda, tidak didukung oleh perangkat Anda. Hubungi pabrikan untuk mendapatkan bantuan." + "Perbarui" + "Masuk" + "Masuk dengan Google" + diff --git a/shell/debug/google/res/values-it/strings.xml b/shell/debug/google/res/values-it/strings.xml new file mode 100644 index 000000000..af7c7004d --- /dev/null +++ b/shell/debug/google/res/values-it/strings.xml @@ -0,0 +1,19 @@ + + + "Installa Google Play Services" + "L\'app non funzionerà senza Google Play Services, non presente sul tuo telefono." + "L\'app non funzionerà senza Google Play Services, non presente sul tuo tablet." + "Installa Google Play Services" + "Attiva Google Play Services" + "L\'app non funzionerà se non attivi Google Play Services." + "Attiva Google Play Services" + "Aggiorna Google Play Services" + "L\'app non funzionerà se non aggiorni Google Play Services." + "Problema sconosciuto con Google Play Services." + "Google Play Services" + "La piattaforma Google Play Services, su cui sono basate alcune delle tue applicazioni, non è supportata dal dispositivo in uso. Per assistenza, contatta il produttore." + "Aggiorna" + "Accedi" + "Accedi con Google" + diff --git a/shell/debug/google/res/values-iw/strings.xml b/shell/debug/google/res/values-iw/strings.xml new file mode 100644 index 000000000..8f273c123 --- /dev/null +++ b/shell/debug/google/res/values-iw/strings.xml @@ -0,0 +1,19 @@ + + + "קבל את שירותי Google Play" + "יישום זה לא יפעל ללא שירותי Google Play, החסרים בטלפון שלך." + "יישום זה לא יפעל ללא שירותי Google Play, החסרים בטאבלט שלך." + "קבל את שירותי Google Play" + "הפעלת שירותי Google Play" + "יישום זה לא יעבוד אם לא תפעיל את שירותי Google Play." + "הפעל את שירותי Google Play" + "עדכון שירותי Google Play" + "יישום זה לא יפעל אם לא תעדכן את שירותי Google Play." + "בעיה לא ידועה בשירותי Google Play." + "שירותי Google Play" + "שירותי Google Play, שחלק מהיישומים שלך מתבססים עליהם, אינם נתמכים על ידי המכשיר שברשותך. צור קשר עם היצרן לקבלת סיוע." + "עדכן" + "היכנס" + "היכנס באמצעות Google" + diff --git a/shell/debug/google/res/values-ja/strings.xml b/shell/debug/google/res/values-ja/strings.xml new file mode 100644 index 000000000..389be837f --- /dev/null +++ b/shell/debug/google/res/values-ja/strings.xml @@ -0,0 +1,19 @@ + + + "Play開発者サービスの入手" + "このアプリの実行にはGoogle Play開発者サービスが必要ですが、お使いの携帯端末にはインストールされていません。" + "このアプリの実行にはGoogle Play開発者サービスが必要ですが、お使いのタブレットにはインストールされていません。" + "Play開発者サービスの入手" + "Play開発者サービスの有効化" + "このアプリの実行には、Google Play開発者サービスの有効化が必要です。" + "Play開発者サービスの有効化" + "Play開発者サービスの更新" + "このアプリの実行には、Google Play開発者サービスの更新が必要です。" + "Google Play開発者サービスで原因不明の問題が発生しました。" + "Google Play開発者サービス" + "一部のアプリが使用しているGoogle Play開発者サービスは、お使いの端末ではサポートされていません。詳しくは、端末メーカーまでお問い合わせください。" + "更新" + "ログイン" + "Googleでログイン" + diff --git a/shell/debug/google/res/values-ko/strings.xml b/shell/debug/google/res/values-ko/strings.xml new file mode 100644 index 000000000..7f52c2777 --- /dev/null +++ b/shell/debug/google/res/values-ko/strings.xml @@ -0,0 +1,19 @@ + + + "Google Play 서비스 설치" + "휴대전화에 Google Play 서비스가 설치되어 있어야 이 앱이 실행됩니다." + "태블릿에 Google Play 서비스가 설치되어 있어야 이 앱이 실행됩니다." + "Google Play 서비스 설치" + "Google Play 서비스 사용" + "Google Play 서비스를 사용하도록 설정해야 이 앱이 작동합니다." + "Google Play 서비스 사용" + "Google Play 서비스 업데이트" + "Google Play 서비스를 업데이트해야만 이 앱이 실행됩니다." + "Google Play 서비스에 알 수 없는 문제가 발생했습니다." + "Google Play 서비스" + "일부 사용자 애플리케이션에 필요한 Google Play 서비스가 사용자 기기에서 지원되지 않습니다. 기기 제조업체에 문의하시기 바랍니다." + "업데이트" + "로그인" + "Google 계정으로 로그인" + diff --git a/shell/debug/google/res/values-lt/strings.xml b/shell/debug/google/res/values-lt/strings.xml new file mode 100644 index 000000000..82f5a75cc --- /dev/null +++ b/shell/debug/google/res/values-lt/strings.xml @@ -0,0 +1,19 @@ + + + "Gauti „Google Play“ paslaugų" + "Ši programa neveiks be „Google Play“ paslaugų, kurios neįdiegtos telefone." + "Ši programa neveiks be „Google Play“ paslaugų, kurios neįdiegtos planšetiniame kompiuteryje." + "Gauti „Google Play“ paslaugų" + "Įgalinti „Google Play“ paslaugas" + "Ši programa neveiks, jei neįgalinsite „Google Play“ paslaugų." + "Įgal. „Google Play“ paslaugas" + "Atnaujinti „Google Play“ paslaugas" + "Ši programa neveiks, jei neatnaujinsite „Google Play“ paslaugų." + "Nežinoma „Google Play“ paslaugų problema." + "„Google Play“ paslaugos" + "Jūsų įrenginys nepalaiko „Google Play“ paslaugų, kuriomis remiasi kai kurios programos. Jei reikia pagalbos, susisiekite su gamintoju." + "Atnaujinti" + "Prisij." + "Prisij. naud. „Google“" + diff --git a/shell/debug/google/res/values-lv/strings.xml b/shell/debug/google/res/values-lv/strings.xml new file mode 100644 index 000000000..332b8265b --- /dev/null +++ b/shell/debug/google/res/values-lv/strings.xml @@ -0,0 +1,19 @@ + + + "Google Play pakalpojumu iegūšana" + "Lai šī lietotne darbotos, tālrunī ir jāinstalē Google Play pakalpojumi." + "Lai šī lietotne darbotos, planšetdatorā ir jāinstalē Google Play pakalpojumi." + "Iegūt Google Play pakalpojumus" + "Google Play pakalpojumu iespējošana" + "Lai šī lietotne darbotos, iespējojiet Google Play pakalpojumus." + "Iespējot Google Play pakalpojumus" + "Google Play pakalpojumu atjaunināšana" + "Lai šī lietotne darbotos, atjauniniet Google Play pakalpojumus." + "Nezināma problēma ar Google Play pakalpojumiem." + "Google Play pakalpojumi" + "Jūsu ierīce neatbalsta Google Play pakalpojumus, kuri nepieciešami dažu jūsu lietojumprogrammu darbībai. Lūdzu, sazinieties ar ražotāju, lai saņemtu palīdzību." + "Atjaunināt" + "Pierakst." + "Pierakstīties Google" + diff --git a/shell/debug/google/res/values-ms/strings.xml b/shell/debug/google/res/values-ms/strings.xml new file mode 100644 index 000000000..27c51f760 --- /dev/null +++ b/shell/debug/google/res/values-ms/strings.xml @@ -0,0 +1,19 @@ + + + "Dapatkan perkhidmatan Google Play" + "Apl ini tidak akan berfungsi tanpa perkhidmatan Google Play dan apl ini tiada pada telefon anda." + "Apl ini tidak akan berfungsi tanpa perkhidmatan Google Play dan apl ini tiada pada tablet anda." + "Dapatkan perkhidmatan Google Play" + "Dayakan perkhidmatan Google Play" + "Apl ini tidak akan berfungsi kecuali anda mendayakan perkhidmatan Google Play." + "Dayakan perkhidmatan Google Play" + "Kemas kini perkhidmatan Google Play" + "Apl ini tidak akan berfungsi kecuali anda mengemas kini perkhidmatan Google Play." + "Isu tidak diketahui dengan perkhidmatan Google Play." + "Perkhidmatan Google Play" + "Peranti anda tidak menyokong perkhidmatan Google Play, sedangkan sesetengah aplikasi anda memerlukannya. Sila hubungi pengilang untuk bantuan." + "Kemas kini" + "Log masuk" + "Log masuk dengan Google" + diff --git a/shell/debug/google/res/values-nb/strings.xml b/shell/debug/google/res/values-nb/strings.xml new file mode 100644 index 000000000..fc7c639b8 --- /dev/null +++ b/shell/debug/google/res/values-nb/strings.xml @@ -0,0 +1,19 @@ + + + "Installer Google Play Tjenester" + "Denne appen kan ikke kjøres uten Google Play Tjenester, som ikke er installert på telefonen din." + "Denne appen kan ikke kjøres uten Google Play Tjenester, som ikke er installert på nettbrettet ditt." + "Installer Google Play Tjenester" + "Aktiver Google Play Tjenester" + "Denne appen fungerer ikke med mindre du aktiverer Google Play Tjenester." + "Aktiver Google Play Tjenester" + "Oppdater Google Play Tjenester" + "Denne appen kan ikke kjøres før du oppdaterer Google Play Tjenester." + "Det oppsto et ukjent problem med Google Play Tjenester." + "Google Play-tjenester" + "Google Play Tjenester, som noen av appene er avhengige av, støttes ikke av enheten. Ta kontakt med produsenten for å få hjelp." + "Oppdater" + "Logg på" + "Logg inn med Google" + diff --git a/shell/debug/google/res/values-nl/strings.xml b/shell/debug/google/res/values-nl/strings.xml new file mode 100644 index 000000000..8749c38fd --- /dev/null +++ b/shell/debug/google/res/values-nl/strings.xml @@ -0,0 +1,19 @@ + + + "Google Play-services ophalen" + "Deze app kan niet worden uitgevoerd zonder Google Play-services die ontbreken op uw telefoon." + "Deze app kan niet worden uitgevoerd zonder Google Play-services die ontbreken op uw tablet." + "Google Play-services ophalen" + "Google Play-services inschakelen" + "Deze app werkt niet, tenzij u Google Play-services inschakelt." + "Google Play-services inschak." + "Google Play-services bijwerken" + "Deze app kan niet worden uitgevoerd, tenzij u Google Play-services bijwerkt." + "Onbekend probleem met Google Play-services." + "Google Play-services" + "Google Play-services, dat vereist is voor een aantal van uw applicaties, wordt niet ondersteund door uw apparaat. Neem contact op met de fabrikant voor ondersteuning." + "Bijwerken" + "Inloggen" + "Inloggen met Google" + diff --git a/shell/debug/google/res/values-pl/strings.xml b/shell/debug/google/res/values-pl/strings.xml new file mode 100644 index 000000000..076e9b98f --- /dev/null +++ b/shell/debug/google/res/values-pl/strings.xml @@ -0,0 +1,19 @@ + + + "Pobierz Usługi Google Play" + "Ta aplikacja nie będzie działać bez Usług Google Play, których nie masz na telefonie." + "Ta aplikacja nie będzie działać bez Usług Google Play, których nie masz na tablecie." + "Pobierz Usługi Google Play" + "Włącz Usługi Google Play" + "Ta aplikacja nie będzie działać, jeśli nie włączysz Usług Google Play." + "Włącz Usługi Google Play" + "Aktualizuj Usługi Google Play" + "Ta aplikacja nie będzie działać, jeśli nie zaktualizujesz Usług Google Play." + "Nieznany problem z Usługami Google Play." + "Usługi Google Play" + "Usługi Google Play, od których zależy działanie niektórych aplikacji, nie są obsługiwane na Twoim urządzeniu. Skontaktuj się z producentem, by uzyskać pomoc." + "Aktualizuj" + "Zaloguj się" + "Zaloguj się przez Google" + diff --git a/shell/debug/google/res/values-pt-rBR/strings.xml b/shell/debug/google/res/values-pt-rBR/strings.xml new file mode 100644 index 000000000..82b0007fb --- /dev/null +++ b/shell/debug/google/res/values-pt-rBR/strings.xml @@ -0,0 +1,19 @@ + + + "Instale o Google Play Services" + "Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu telefone." + "Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu tablet." + "Instalar o Google Play Services" + "Ative o Google Play Services" + "Este aplicativo só funciona com o Google Play Services ativado." + "Ativar o Google Play Services" + "Atualize o Google Play Services" + "Este aplicativo só funciona com uma versão atualizada do Google Play Services." + "Problema desconhecido com o Google Play Services." + "Play Services" + "O Google Play Services, necessário para alguns dos aplicativos, não é compatível com seu dispositivo. Entre em contato com o fabricante para obter assistência." + "Atualizar" + "Login" + "Fazer login com o Google" + diff --git a/shell/debug/google/res/values-pt-rPT/strings.xml b/shell/debug/google/res/values-pt-rPT/strings.xml new file mode 100644 index 000000000..10e8c84a8 --- /dev/null +++ b/shell/debug/google/res/values-pt-rPT/strings.xml @@ -0,0 +1,19 @@ + + + "Obter serviços do Google Play" + "Esta aplicação não será executada sem os serviços do Google Play, que estão em falta no seu telemóvel." + "Esta aplicação não será executada sem os serviços do Google Play, que estão em falta no seu tablet." + "Obter serviços do Google Play" + "Ativar serviços do Google Play" + "Esta aplicação não funcionará enquanto não ativar os serviços do Google Play." + "Ativar serviços do Google Play" + "Atualizar serviços do Google Play" + "Esta aplicação não será executada enquanto não atualizar os serviços do Google Play." + "Problema desconhecido nos serviços do Google Play." + "Serviços do Google Play" + "Os serviços do Google Play, dos quais dependem algumas das suas aplicações, não são suportados pelo seu dispositivo. Contacte o fabricante para obter assistência." + "Atualizar" + "Inic. ses." + "Inic. sessão com o Google" + diff --git a/shell/debug/google/res/values-pt/strings.xml b/shell/debug/google/res/values-pt/strings.xml new file mode 100644 index 000000000..82b0007fb --- /dev/null +++ b/shell/debug/google/res/values-pt/strings.xml @@ -0,0 +1,19 @@ + + + "Instale o Google Play Services" + "Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu telefone." + "Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu tablet." + "Instalar o Google Play Services" + "Ative o Google Play Services" + "Este aplicativo só funciona com o Google Play Services ativado." + "Ativar o Google Play Services" + "Atualize o Google Play Services" + "Este aplicativo só funciona com uma versão atualizada do Google Play Services." + "Problema desconhecido com o Google Play Services." + "Play Services" + "O Google Play Services, necessário para alguns dos aplicativos, não é compatível com seu dispositivo. Entre em contato com o fabricante para obter assistência." + "Atualizar" + "Login" + "Fazer login com o Google" + diff --git a/shell/debug/google/res/values-ro/strings.xml b/shell/debug/google/res/values-ro/strings.xml new file mode 100644 index 000000000..8d8260b8b --- /dev/null +++ b/shell/debug/google/res/values-ro/strings.xml @@ -0,0 +1,19 @@ + + + "Descărcaţi Servicii Google Play" + "Această aplicaţie nu poate rula fără Servicii Google Play, care lipsesc de pe telefon." + "Această aplicaţie nu poate rula fără Servicii Google Play, care lipsesc de pe tabletă." + "Obţineţi Servicii Google Play" + "Activaţi Servicii Google Play" + "Această aplicaţie nu va funcţiona decât dacă activaţi Servicii Google Play." + "Activaţi Servicii Google Play" + "Actualizaţi Servicii Google Play" + "Această aplicaţie nu poate rula decât dacă actualizaţi Servicii Google Play." + "Problemă necunoscută privind Servicii Google Play." + "Servicii Google Play" + "Gadgetul nu acceptă serviciile Google Play, pe care se bazează unele dintre aplicații. Pentru asistență, contactați producătorul gadgetului." + "Actualizaţi" + "Conectați" + "Conectați-vă cu Google" + diff --git a/shell/debug/google/res/values-ru/strings.xml b/shell/debug/google/res/values-ru/strings.xml new file mode 100644 index 000000000..e1b4ce7f1 --- /dev/null +++ b/shell/debug/google/res/values-ru/strings.xml @@ -0,0 +1,19 @@ + + + "Установите Сервисы Google Play" + "Для работы этого приложения требуется установить Сервисы Google Play." + "Для работы этого приложения требуется установить Сервисы Google Play." + "Установить" + "Включите Сервисы Google Play" + "Для работы этого приложения требуется включить Сервисы Google Play." + "Включить" + "Обновите Сервисы Google Play" + "Для работы этого приложения требуется обновить Сервисы Google Play." + "Неизвестная ошибка с Сервисами Google Play." + "Сервисы Google Play" + "Сервисы Google Play, необходимые для работы некоторых приложений, не поддерживаются на вашем устройстве. Обратитесь к производителю." + "Обновить" + "Войти" + "Войти в аккаунт Google" + diff --git a/shell/debug/google/res/values-sk/strings.xml b/shell/debug/google/res/values-sk/strings.xml new file mode 100644 index 000000000..2351ca73d --- /dev/null +++ b/shell/debug/google/res/values-sk/strings.xml @@ -0,0 +1,19 @@ + + + "Inštalovať služby Google Play" + "Na spustenie tejto aplikácie sa vyžadujú služby Google Play, ktoré v telefóne nemáte." + "Na spustenie tejto aplikácie sa vyžadujú služby Google Play, ktoré v tablete nemáte." + "Inštalovať služby Google Play" + "Povoliť služby Google Play" + "Táto aplikácia bude fungovať až po povolení služieb Google Play." + "Povoliť služby Google Play" + "Aktualizovať služby Google Play" + "Túto aplikáciu bude možné spustiť až po aktualizácii služieb Google Play." + "Neznámy problém so službami Google Play." + "Služby Google Play" + "Niektoré vaše aplikácie vyžadujú služby Google Play, ktoré vo vašom zariadení nie sú podporované. Ak potrebujete pomoc, kontaktujte výrobcu." + "Aktualizovať" + "Prihlásiť sa" + "Prihlásiť sa do účtu Google" + diff --git a/shell/debug/google/res/values-sl/strings.xml b/shell/debug/google/res/values-sl/strings.xml new file mode 100644 index 000000000..d99cb8d14 --- /dev/null +++ b/shell/debug/google/res/values-sl/strings.xml @@ -0,0 +1,19 @@ + + + "Namestite storitve Google Play" + "Ta aplikacija ne deluje brez storitev Google Play, ki jih ni v telefonu." + "Ta aplikacija ne deluje brez storitev Google Play, ki jih ni v tabličnem računalniku." + "Namestite storitve Google Play" + "Omogočite storitve Google Play" + "Aplikacija ne bo delovala, če ne omogočite storitev Google Play." + "Omogočite storitve Google Play" + "Posodobite storitve Google Play" + "Ta aplikacija ne deluje, če ne posodobite storitev Google Play." + "Neznana težava s storitvami Google Play." + "Storitve Google Play" + "Vaša naprava na podpira storitev Google Play, ki jih potrebujejo nekatere od vaših aplikacij. Za pomoč se obrnite na izdelovalca." + "Posodobi" + "Prijava" + "Prijavite se v Google" + diff --git a/shell/debug/google/res/values-sr/strings.xml b/shell/debug/google/res/values-sr/strings.xml new file mode 100644 index 000000000..1fa72cd26 --- /dev/null +++ b/shell/debug/google/res/values-sr/strings.xml @@ -0,0 +1,19 @@ + + + "Преузимање Google Play услуга" + "Ова апликација не може да се покрене без Google Play услуга, које недостају на телефону." + "Ова апликација не може да се покрене без Google Play услуга, које недостају на таблету." + "Преузми Google Play услуге" + "Омогућавање Google Play услуга" + "Ова апликација неће функционисати ако не омогућите Google Play услуге." + "Омогући Google Play услуге" + "Ажурирање Google Play услуга" + "Ова апликација не може да се покрене ако не ажурирате Google Play услуге." + "Непознат проблем са Google Play услугама." + "Google Play услуге" + "Google Play услуге, које су потребне за функционисање неких од апликација, нису подржане на уређају. Контактирајте произвођача да бисте добили помоћ." + "Ажурирај" + "Пријави ме" + "Пријави ме преко Google-а" + diff --git a/shell/debug/google/res/values-sv/strings.xml b/shell/debug/google/res/values-sv/strings.xml new file mode 100644 index 000000000..c30862a85 --- /dev/null +++ b/shell/debug/google/res/values-sv/strings.xml @@ -0,0 +1,19 @@ + + + "Hämta Google Play Tjänster" + "Den här appen kan inte köras utan Google Play Tjänster, som saknas på mobilen." + "Den här appen kan inte köras utan Google Play Tjänster, som saknas på surfplattan." + "Hämta Google Play Tjänster" + "Aktivera Google Play Tjänster" + "Du måste aktivera Google Play Tjänster för att den här appen ska fungera." + "Aktivera Google Play Tjänster" + "Uppdatera Google Play Tjänster" + "Du måste uppdatera Google Play Tjänster innan du kan köra den här appen." + "Okänt problem med Google Play Tjänster" + "Google Play-tjänster" + "Några av dina appar använder Google Play-tjänster som inte stöds av din enhet. Kontakta tillverkaren om du vill ha hjälp." + "Uppdatera" + "Logga in" + "Logga in med Google" + diff --git a/shell/debug/google/res/values-sw/strings.xml b/shell/debug/google/res/values-sw/strings.xml new file mode 100644 index 000000000..e6f84e986 --- /dev/null +++ b/shell/debug/google/res/values-sw/strings.xml @@ -0,0 +1,19 @@ + + + "Pata huduma za Google Play" + "Programu hii haiwezi kuendeshwa bila huduma za Google Play, ambazo hazipo kwenye simu yako." + "Programu hii haiwezi kuendeshwa bila huduma za Google Play, ambazo hazipo kwenye kompyuta yako ndogo." + "Pata huduma za Google Play" + "Wezesha huduma za Google Play" + "Programu hii haitafanya kazi mpaka utakapowezesha huduma za Google Play." + "Wezesha huduma za Google Play" + "Sasisha huduma za Google Play" + "Programu hii haiwezi kuendeshwa mpaka utakaposasisha huduma za Google Play." + "Suala lisilojulikana na huduma za Google Play." + "Huduma za Google Play" + "Huduma za Google Play, ambazo baadhi ya programu zako zinategemea, si linganifu na kifaa chako. Tafadhali wasiliana na mtengenezaji kwa usaidizi." + "Sasisha" + "Ingia" + "Ingia ukitumia Google" + diff --git a/shell/debug/google/res/values-th/strings.xml b/shell/debug/google/res/values-th/strings.xml new file mode 100644 index 000000000..583b6f879 --- /dev/null +++ b/shell/debug/google/res/values-th/strings.xml @@ -0,0 +1,19 @@ + + + "รับบริการ Google Play" + "แอปพลิเคชันนี้จะไม่ทำงานหากไม่มีบริการ Google Play ซึ่งไม่มีในโทรศัพท์ของคุณ" + "แอปพลิเคชันนี้จะไม่ทำงานหากไม่มีบริการ Google Play ซึ่งไม่มีในแท็บเล็ตของคุณ" + "รับบริการ Google Play" + "เปิดใช้งานบริการ Google Play" + "แอปพลิเคชันนี้จะไม่ทำงานจนกว่าคุณจะเปิดใช้งานบริการ Google Play" + "เปิดใช้งานบริการ Google Play" + "อัปเดตบริการ Google Play" + "แอปพลิเคชันนี้จะไม่ทำงานจนกว่าคุณจะอัปเดตบริการ Google Play" + "ปัญหาที่ไม่รู้จักของบริการ Google Play" + "บริการ Google Play" + "บริการ Google Play ซึ่งใช้งานในบางแอปพลิเคชัน ไม่ได้รับการสนับสนุนโดยอุปกรณ์ของคุณ โปรดติดต่อผู้ผลิตเพื่อขอรับความช่วยเหลือ" + "อัปเดต" + "ลงชื่อใช้" + "ลงชื่อเข้าใช้ด้วย Google" + diff --git a/shell/debug/google/res/values-tl/strings.xml b/shell/debug/google/res/values-tl/strings.xml new file mode 100644 index 000000000..e6ffbc9c5 --- /dev/null +++ b/shell/debug/google/res/values-tl/strings.xml @@ -0,0 +1,19 @@ + + + "Kumuha ng mga serbisyo ng Google Play" + "Hindi tatakbo ang app na ito nang wala ang mga serbisyo ng Google Play, na wala sa iyong telepono." + "Hindi gagana ang app na ito nang wala ang mga serbisyo ng Google Play, na wala sa iyong tablet." + "Kumuha ng Google Play services" + "Paganahin ang Google Play services" + "Hindi gagana ang app na ito maliban kung papaganahin mo ang mga serbisyo ng Google Play." + "Enable Google Play services" + "I-update ang mga serbisyo ng Google Play" + "Hindi gagana ang app na ito maliban kung i-a-update mo ang mga serbisyo ng Google Play." + "May hindi alam na isyu sa mga serbisyo ng Google Play." + "Mga serbisyo ng Google Play" + "Ang mga serbisyo ng Google Play, kung saan nakadepende ang ilan sa iyong mga application, ay hindi sinusuportahan ng iyong device. Mangyaring makipag-ugnay sa manufacturer para sa tulong." + "I-update" + "Sign in" + "Mag-sign in sa Google" + diff --git a/shell/debug/google/res/values-tr/strings.xml b/shell/debug/google/res/values-tr/strings.xml new file mode 100644 index 000000000..b550059a1 --- /dev/null +++ b/shell/debug/google/res/values-tr/strings.xml @@ -0,0 +1,19 @@ + + + "Google Play hizmetlerini edinin" + "Google Play Hizmetleri telefonunuzda yok ve bu uygulama Google Play Hizmetleri olmadan çalışmaz." + "Google Play Hizmetleri tabletinizde yok ve bu uygulama Google Play Hizmetleri olmadan çalışmaz." + "Google Play hizmetlerini edin" + "Google Play hizmetlerini etkinleştir" + "Bu uygulama, Google Play Hizmetleri etkinleştirilmeden çalışmaz" + "Google Play hizmetlerini etkinleştir" + "Google Play hizmetlerini güncelle" + "Bu uygulama Google Play Hizmetleri güncellenmeden çalışmaz." + "Google Play hizmetleriyle ilgili bilinmeyen sorun." + "Google Play hizmetleri" + "Cihazınız, uygulamalarınızdan bazıları için gerekli olan Google Play hizmetlerini desteklemiyor. Lütfen yardım için üreticiyle iletişim kurun." + "Güncelle" + "Oturum aç" + "Google\'da oturum aç" + diff --git a/shell/debug/google/res/values-uk/strings.xml b/shell/debug/google/res/values-uk/strings.xml new file mode 100644 index 000000000..a12060c09 --- /dev/null +++ b/shell/debug/google/res/values-uk/strings.xml @@ -0,0 +1,19 @@ + + + "Установити Google Play Послуги" + "Ця програма не запуститься без Google Play Послуг, яких немає у вашому телефоні." + "Ця програма не запуститься без Google Play Послуг, яких немає на вашому планшетному ПК." + "Установити Google Play Послуги" + "Увімкнути Google Play Послуги" + "Ця програма не працюватиме, поки ви не ввімкнете Google Play Послуги." + "Увімкнути Google Play Послуги" + "Оновити Google Play Послуги" + "Ця програма не запуститься, поки ви не оновите Google Play Послуги." + "Google Play Послуги – невідома проблема." + "Сервіси Google Play" + "Ваш пристрій не підтримує Сервіси Google Play, від яких залежить робота деяких програм. Зверніться по допомогу до виробника." + "Оновити" + "Увійти" + "Увійти в обл.запис Google" + diff --git a/shell/debug/google/res/values-vi/strings.xml b/shell/debug/google/res/values-vi/strings.xml new file mode 100644 index 000000000..bd9eaa5c2 --- /dev/null +++ b/shell/debug/google/res/values-vi/strings.xml @@ -0,0 +1,19 @@ + + + "Cài đặt dịch vụ của Google Play" + "Ứng dụng này sẽ không chạy nếu không có dịch vụ của Google Play. Điện thoại của bạn bị thiếu dịch vụ này." + "Ứng dụng này sẽ không chạy nếu không có dịch vụ của Google Play. Máy tính bảng của bạn bị thiếu dịch vụ này." + "Cài đặt dịch vụ của Google Play" + "Bật dịch vụ của Google Play" + "Ứng dụng này sẽ không hoạt động trừ khi bạn bật dịch vụ của Google Play." + "Bật dịch vụ của Google Play" + "Cập nhật dịch vụ của Google Play" + "Ứng dụng này sẽ không chạy trừ khi bạn cập nhật dịch vụ của Google Play." + "Sự cố không xác định với dịch vụ của Google Play." + "Dịch vụ của Google Play" + "Các dịch vụ của Google Play mà một số ứng dụng của bạn dựa vào không được thiết bị của bạn hỗ trợ. Vui lòng liên hệ với nhà sản xuất để được hỗ trợ." + "Cập nhật" + "Đăng nhập" + "Đăng nhập bằng Google" + diff --git a/shell/debug/google/res/values-zh-rCN/strings.xml b/shell/debug/google/res/values-zh-rCN/strings.xml new file mode 100644 index 000000000..0f189e330 --- /dev/null +++ b/shell/debug/google/res/values-zh-rCN/strings.xml @@ -0,0 +1,19 @@ + + + "获取 Google Play 服务" + "您的手机中没有 Google Play 服务,您必须先安装该服务才能运行此应用。" + "您的平板电脑中没有 Google Play 服务,您必须先安装该服务才能运行此应用。" + "获取 Google Play 服务" + "启用 Google Play 服务" + "您必须先启用 Google Play 服务才能运行此应用。" + "启用 Google Play 服务" + "更新 Google Play 服务" + "您必须先更新 Google Play 服务才能运行此应用。" + "Google Play 服务出现未知问题。" + "Google Play 服务" + "您的设备不支持部分应用所依赖的 Google Play 服务。请与设备制造商联系,以寻求帮助。" + "更新" + "登录" + "使用 Google 帐户登录" + diff --git a/shell/debug/google/res/values-zh-rTW/strings.xml b/shell/debug/google/res/values-zh-rTW/strings.xml new file mode 100644 index 000000000..1bcbb0d98 --- /dev/null +++ b/shell/debug/google/res/values-zh-rTW/strings.xml @@ -0,0 +1,19 @@ + + + "取得 Google Play 服務" + "您的手機並未安裝 Google Play 服務,所以無法執行這個應用程式。" + "您的平板電腦並未安裝 Google Play 服務,所以無法執行這個應用程式。" + "取得 Google Play 服務" + "啟用 Google Play 服務" + "您必須啟用 Google Play 服務,這個應用程式才能運作。" + "啟用 Google Play 服務" + "更新 Google Play 服務" + "您必須更新 Google Play 服務,才能執行這個應用程式。" + "Google Play 服務發生不明問題。" + "Google Play 服務" + "您的裝置不支援部分應用程式所需的 Google Play 服務。如需協助,請與您的裝置製造商聯絡。" + "更新" + "登入" + "使用 Google 帳戶登入" + diff --git a/shell/debug/google/res/values-zu/strings.xml b/shell/debug/google/res/values-zu/strings.xml new file mode 100644 index 000000000..56137399e --- /dev/null +++ b/shell/debug/google/res/values-zu/strings.xml @@ -0,0 +1,19 @@ + + + "Thola amasevisi e-Google Play" + "Lolu hlelo lokusebenza ngeke lusebenze ngaphandle kwamasevisi e-Google Play, angekho efonini yakho." + "Lolu hlelo lokusebenza ngeke lusebenze ngaphandle kwamasevisi e-Google Play, angekho kuthebulethi yakho." + "Thola amasevisi e-Google Play" + "Nika amandla amasevisi e-Google Play" + "Lolu hlelo lokusebenza ngeke lusebenze ngaphandle nje kokuthi unike amandla amasevisi e-Google Play." + "Nika amandla amasevisi e-Google Play" + "Buyekeza amasevisi e-Google Play" + "Lolu hlelo lokusebenza ngeke lusebenze ngaphandle nje kokuthi ubuyekeze amasevisi e-Google Play." + "Indaba engaziwa yamasevisi we-Google Play" + "Amasevisi we-Google Play" + "Amasevisi we-Google Play, okungukuthi ezinye izinhlelo zakho zithembele kuwo, awasekelwe yidivayisi yakho. Sicela uxhumane nomkhiqizi ukuze uthole usizo." + "Isibuyekezo" + "Ngena ngemvume" + "Ngena ngemvume nge-Google" + diff --git a/shell/debug/google/res/values/colors.xml b/shell/debug/google/res/values/colors.xml new file mode 100644 index 000000000..6b2740a50 --- /dev/null +++ b/shell/debug/google/res/values/colors.xml @@ -0,0 +1,14 @@ + + + + @android:color/white + @android:color/white + #FFAAAAAA + @android:color/white + #FF737373 + @android:color/white + #FFAAAAAA + #FF737373 + #FFDD4B39 + #d2d2d2 + \ No newline at end of file diff --git a/shell/debug/google/res/values/maps_attrs.xml b/shell/debug/google/res/values/maps_attrs.xml new file mode 100644 index 000000000..aaf65c529 --- /dev/null +++ b/shell/debug/google/res/values/maps_attrs.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shell/debug/google/res/values/strings.xml b/shell/debug/google/res/values/strings.xml new file mode 100644 index 000000000..64f2bd049 --- /dev/null +++ b/shell/debug/google/res/values/strings.xml @@ -0,0 +1,88 @@ + + + + + Get Google Play services + + + This app won\'t run without Google Play services, which are missing from your phone. + + + This app won\'t run without Google Play services, which are missing from your tablet. + + + Get Google Play services + + + Enable Google Play services + + + This app won\'t work unless you enable Google Play services. + + + Enable Google Play services + + + Update Google Play services + + + This app won\'t run unless you update Google Play services. + + + Unknown issue with Google Play services. + + + Google Play services + + + Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance. + + + Update + + + Sign in + + + Sign in with Google + + + + Install/Update/Enable Google Play services + + + Google Play services error + + + Requested by %1$s + + + + + + + + + AgeUnder13 + + AgeUnknown + + UnknownRestriction + + + + diff --git a/shell/debug/google/src/android/UnusedStub.java b/shell/debug/google/src/android/UnusedStub.java new file mode 100644 index 000000000..d546b0ba9 --- /dev/null +++ b/shell/debug/google/src/android/UnusedStub.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android; + +// Stub java file to make inclusion into some IDE's work. +public final class UnusedStub { + private UnusedStub() { } +} diff --git a/shell/debug/google/src/com/google/games/basegameutils/GameHelper.java b/shell/debug/google/src/com/google/games/basegameutils/GameHelper.java new file mode 100755 index 000000000..1cce0f5a1 --- /dev/null +++ b/shell/debug/google/src/com/google/games/basegameutils/GameHelper.java @@ -0,0 +1,788 @@ +/* + * Copyright (C) 2013 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.games.basegameutils; + +import java.util.Vector; + +import android.app.Activity; +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.Intent; +import android.content.IntentSender.SendIntentException; +import android.os.Bundle; +import android.util.Log; +import android.view.Gravity; + +import com.google.android.gms.appstate.AppStateClient; +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.GooglePlayServicesClient; +import com.google.android.gms.common.GooglePlayServicesUtil; +import com.google.android.gms.common.Scopes; +import com.google.android.gms.games.GamesClient; +import com.google.android.gms.games.OnSignOutCompleteListener; +import com.google.android.gms.games.multiplayer.Invitation; +import com.google.android.gms.plus.PlusClient; + +public class GameHelper implements + GooglePlayServicesClient.ConnectionCallbacks, + GooglePlayServicesClient.OnConnectionFailedListener, + OnSignOutCompleteListener { + + /** Listener for sign-in success or failure events. */ + public interface GameHelperListener { + /** + * Called when sign-in fails. As a result, a "Sign-In" button can be + * shown to the user; when that button is clicked, call + * + * @link{GamesHelper#beginUserInitiatedSignIn . Note that not all calls + * to this method mean an + * error; it may be a result + * of the fact that automatic + * sign-in could not proceed + * because user interaction + * was required (consent + * dialogs). So + * implementations of this + * method should NOT display + * an error message unless a + * call to @link{GamesHelper# + * hasSignInError} indicates + * that an error indeed + * occurred. + */ + void onSignInFailed(); + + /** Called when sign-in succeeds. */ + void onSignInSucceeded(); + } + + /** + * The Activity we are bound to. We need to keep a reference to the Activity + * because some games methods require an Activity (a Context won't do). We + * are careful not to leak these references: we release them on onStop(). + */ + Activity mActivity = null; + + // OAuth scopes required for the clients. Initialized in setup(). + String mScopes[]; + + // Request code we use when invoking other Activities to complete the + // sign-in flow. + final static int RC_RESOLVE = 9001; + + // Request code when invoking Activities whose result we don't care about. + final static int RC_UNUSED = 9002; + + // Client objects we manage. If a given client is not enabled, it is null. + GamesClient mGamesClient = null; + PlusClient mPlusClient = null; + AppStateClient mAppStateClient = null; + + // What clients we manage (OR-able values, can be combined as flags) + public final static int CLIENT_NONE = 0x00; + public final static int CLIENT_GAMES = 0x01; + public final static int CLIENT_PLUS = 0x02; + public final static int CLIENT_APPSTATE = 0x04; + public final static int CLIENT_ALL = CLIENT_GAMES | CLIENT_PLUS + | CLIENT_APPSTATE; + + // What clients were requested? (bit flags) + int mRequestedClients = CLIENT_NONE; + + // What clients are currently connected? (bit flags) + int mConnectedClients = CLIENT_NONE; + + // What client are we currently connecting? + int mClientCurrentlyConnecting = CLIENT_NONE; + + // A progress dialog we show when we are trying to sign the user is + ProgressDialog mProgressDialog = null; + + // Whether to automatically try to sign in on onStart(). + boolean mAutoSignIn = true; + + /* + * Whether user has specifically requested that the sign-in process begin. + * If mUserInitiatedSignIn is false, we're in the automatic sign-in attempt + * that we try once the Activity is started -- if true, then the user has + * already clicked a "Sign-In" button or something similar + */ + boolean mUserInitiatedSignIn = false; + + // The connection result we got from our last attempt to sign-in. + ConnectionResult mConnectionResult = null; + + // Whether our sign-in attempt resulted in an error. In this case, + // mConnectionResult + // indicates what was the error we failed to resolve. + boolean mSignInError = false; + + // Whether we launched the sign-in dialog flow and therefore are expecting + // an + // onActivityResult with the result of that. + boolean mExpectingActivityResult = false; + + // Are we signed in? + boolean mSignedIn = false; + + // Print debug logs? + boolean mDebugLog = false; + String mDebugTag = "BaseGameActivity"; + + // Messages (can be set by the developer). + String mSigningInMessage = ""; + String mSigningOutMessage = ""; + String mUnknownErrorMessage = "Unknown error"; + + // If we got an invitation id when we connected to the games client, it's + // here. + // Otherwise, it's null. + String mInvitationId; + + // Listener + GameHelperListener mListener = null; + + /** + * Construct a GameHelper object, initially tied to the given Activity. + * After constructing this object, call @link{setup} from the onCreate() + * method of your Activity. + */ + public GameHelper(Activity activity) { + mActivity = activity; + } + + /** Sets the message that appears onscreen while signing in. */ + public void setSigningInMessage(String message) { + mSigningInMessage = message; + } + + /** Sets the message that appears onscreen while signing out. */ + public void setSigningOutMessage(String message) { + mSigningOutMessage = message; + } + + /** + * Sets the message that appears onscreen when there is an unknown error + * (rare!) + */ + public void setUnknownErrorMessage(String message) { + mUnknownErrorMessage = message; + } + + /** + * Same as calling @link{setup(GameHelperListener, int)} requesting only the + * CLIENT_GAMES client. + */ + public void setup(GameHelperListener listener) { + setup(listener, CLIENT_GAMES); + } + + /** + * Performs setup on this GameHelper object. Call this from the onCreate() + * method of your Activity. This will create the clients and do a few other + * initialization tasks. Next, call @link{#onStart} from the onStart() + * method of your Activity. + * + * @param listener + * The listener to be notified of sign-in events. + * @param clientsToUse + * The clients to use. Use a combination of CLIENT_GAMES, + * CLIENT_PLUS and CLIENT_APPSTATE, or CLIENT_ALL to request all + * clients. + */ + public void setup(GameHelperListener listener, int clientsToUse) { + mListener = listener; + mRequestedClients = clientsToUse; + + Vector scopesVector = new Vector(); + if (0 != (clientsToUse & CLIENT_GAMES)) { + scopesVector.add(Scopes.GAMES); + } + if (0 != (clientsToUse & CLIENT_PLUS)) { + scopesVector.add(Scopes.PLUS_LOGIN); + } + if (0 != (clientsToUse & CLIENT_APPSTATE)) { + scopesVector.add(Scopes.APP_STATE); + } + + mScopes = new String[scopesVector.size()]; + scopesVector.copyInto(mScopes); + + if (0 != (clientsToUse & CLIENT_GAMES)) { + debugLog("onCreate: creating GamesClient"); + mGamesClient = new GamesClient.Builder(getContext(), this, this) + .setGravityForPopups( + Gravity.TOP | Gravity.CENTER_HORIZONTAL) + .setScopes(mScopes).create(); + } + + if (0 != (clientsToUse & CLIENT_PLUS)) { + debugLog("onCreate: creating GamesPlusClient"); + mPlusClient = new PlusClient.Builder(getContext(), this, this) + .setScopes(mScopes).build(); + } + + if (0 != (clientsToUse & CLIENT_APPSTATE)) { + debugLog("onCreate: creating AppStateClient"); + mAppStateClient = new AppStateClient.Builder(getContext(), this, + this).setScopes(mScopes).create(); + } + } + + /** + * Returns the GamesClient object. In order to call this method, you must + * have called @link{setup} with a set of clients that includes + * CLIENT_GAMES. + */ + public GamesClient getGamesClient() { + if (mGamesClient == null) { + throw new IllegalStateException( + "No GamesClient. Did you request it at setup?"); + } + return mGamesClient; + } + + /** + * Returns the AppStateClient object. In order to call this method, you must + * have called @link{#setup} with a set of clients that includes + * CLIENT_APPSTATE. + */ + public AppStateClient getAppStateClient() { + if (mAppStateClient == null) { + throw new IllegalStateException( + "No AppStateClient. Did you request it at setup?"); + } + return mAppStateClient; + } + + /** + * Returns the PlusClient object. In order to call this method, you must + * have called @link{#setup} with a set of clients that includes + * CLIENT_PLUS. + */ + public PlusClient getPlusClient() { + if (mPlusClient == null) { + throw new IllegalStateException( + "No PlusClient. Did you request it at setup?"); + } + return mPlusClient; + } + + /** Returns whether or not the user is signed in. */ + public boolean isSignedIn() { + return mSignedIn; + } + + /** + * Returns whether or not there was a (non-recoverable) error during the + * sign-in process. + */ + public boolean hasSignInError() { + return mSignInError; + } + + /** + * Returns the error that happened during the sign-in process, null if no + * error occurred. + */ + public ConnectionResult getSignInError() { + return mSignInError ? mConnectionResult : null; + } + + /** Call this method from your Activity's onStart(). */ + public void onStart(Activity act) { + mActivity = act; + + debugLog("onStart."); + if (mExpectingActivityResult) { + // this Activity is starting because the UI flow we launched to + // resolve a connection problem has just returned. In this case, + // we should NOT automatically reconnect the client, since + // onActivityResult will handle that. + debugLog("onStart: won't connect because we're expecting activity result."); + } else if (!mAutoSignIn) { + // The user specifically signed out, so don't attempt to sign in + // automatically. If the user wants to sign in, they will click + // the sign-in button, at which point we will try to sign in. + debugLog("onStart: not signing in because user specifically signed out."); + } else { + // Attempt to connect the clients. + debugLog("onStart: connecting clients."); + startConnections(); + } + } + + /** Call this method from your Activity's onStop(). */ + public void onStop() { + debugLog("onStop: disconnecting clients."); + + // disconnect the clients -- this is very important (prevents resource + // leaks!) + killConnections(CLIENT_ALL); + + // no longer signed in + mSignedIn = false; + mSignInError = false; + + // destroy progress dialog -- we create it again when needed + dismissDialog(); + mProgressDialog = null; + + // let go of the Activity reference + mActivity = null; + } + + /** Convenience method to show an alert dialog. */ + public void showAlert(String title, String message) { + (new AlertDialog.Builder(getContext())).setTitle(title) + .setMessage(message) + .setNeutralButton(android.R.string.ok, null).create().show(); + } + + /** Convenience method to show an alert dialog. */ + public void showAlert(String message) { + (new AlertDialog.Builder(getContext())).setMessage(message) + .setNeutralButton(android.R.string.ok, null).create().show(); + } + + /** + * Returns the invitation ID received through an invitation notification. + * This should be called from your GameHelperListener's + * + * @link{GameHelperListener#onSignInSucceeded method, to check if there's an + * invitation available. In that + * case, accept the invitation. + * @return The id of the invitation, or null if none was received. + */ + public String getInvitationId() { + return mInvitationId; + } + + /** Enables debug logging, with the given logcat tag. */ + public void enableDebugLog(boolean enabled, String tag) { + mDebugLog = enabled; + mDebugTag = tag; + } + + /** + * Returns the current requested scopes. This is not valid until setup() has + * been called. + * + * @return the requested scopes, including the oauth2: prefix + */ + public String getScopes() { + StringBuilder scopeStringBuilder = new StringBuilder(); + int clientsToUse = mRequestedClients; + // GAMES implies PLUS_LOGIN + if (0 != (clientsToUse & CLIENT_GAMES)) { + addToScope(scopeStringBuilder, Scopes.GAMES); + } + if (0 != (clientsToUse & CLIENT_PLUS)) { + addToScope(scopeStringBuilder, Scopes.PLUS_LOGIN); + } + if (0 != (clientsToUse & CLIENT_APPSTATE)) { + addToScope(scopeStringBuilder, Scopes.APP_STATE); + } + return scopeStringBuilder.toString(); + } + + /** Sign out and disconnect from the APIs. */ + public void signOut() { + mConnectionResult = null; + mAutoSignIn = false; + mSignedIn = false; + mSignInError = false; + + if (mPlusClient != null && mPlusClient.isConnected()) { + mPlusClient.clearDefaultAccount(); + } + if (mGamesClient != null && mGamesClient.isConnected()) { + showProgressDialog(false); + mGamesClient.signOut(this); + } + + // kill connects to all clients but games, which must remain + // connected til we get onSignOutComplete() + killConnections(CLIENT_ALL & ~CLIENT_GAMES); + } + + /** + * Handle activity result. Call this method from your Activity's + * onActivityResult callback. If the activity result pertains to the sign-in + * process, processes it appropriately. + */ + public void onActivityResult(int requestCode, int responseCode, + Intent intent) { + if (requestCode == RC_RESOLVE) { + // We're coming back from an activity that was launched to resolve a + // connection + // problem. For example, the sign-in UI. + mExpectingActivityResult = false; + debugLog("onActivityResult, req " + requestCode + " response " + + responseCode); + if (responseCode == Activity.RESULT_OK) { + // Ready to try to connect again. + debugLog("responseCode == RESULT_OK. So connecting."); + connectCurrentClient(); + } else { + // Whatever the problem we were trying to solve, it was not + // solved. + // So give up and show an error message. + debugLog("responseCode != RESULT_OK, so not reconnecting."); + giveUp(); + } + } + } + + /** + * Starts a user-initiated sign-in flow. This should be called when the user + * clicks on a "Sign In" button. As a result, authentication/consent dialogs + * may show up. At the end of the process, the GameHelperListener's + * onSignInSucceeded() or onSignInFailed() methods will be called. + */ + public void beginUserInitiatedSignIn() { + if (mSignedIn) + return; // nothing to do + + // reset the flag to sign in automatically on onStart() -- now a + // wanted behavior + mAutoSignIn = true; + + // Is Google Play services available? + int result = GooglePlayServicesUtil + .isGooglePlayServicesAvailable(getContext()); + debugLog("isGooglePlayServicesAvailable returned " + result); + if (result != ConnectionResult.SUCCESS) { + // Nope. + debugLog("Google Play services not available. Show error dialog."); + Dialog errorDialog = getErrorDialog(result); + errorDialog.show(); + if (mListener != null) + mListener.onSignInFailed(); + return; + } + + mUserInitiatedSignIn = true; + if (mConnectionResult != null) { + // We have a pending connection result from a previous failure, so + // start with that. + debugLog("beginUserInitiatedSignIn: continuing pending sign-in flow."); + showProgressDialog(true); + resolveConnectionResult(); + } else { + // We don't have a pending connection result, so start anew. + debugLog("beginUserInitiatedSignIn: starting new sign-in flow."); + startConnections(); + } + } + + Context getContext() { + return mActivity; + } + + void addToScope(StringBuilder scopeStringBuilder, String scope) { + if (scopeStringBuilder.length() == 0) { + scopeStringBuilder.append("oauth2:"); + } else { + scopeStringBuilder.append(" "); + } + scopeStringBuilder.append(scope); + } + + void startConnections() { + mConnectedClients = CLIENT_NONE; + mInvitationId = null; + connectNextClient(); + } + + void showProgressDialog(boolean signIn) { + String message = signIn ? mSigningInMessage : mSigningOutMessage; + + if (mProgressDialog == null) { + if (getContext() == null) + return; + mProgressDialog = new ProgressDialog(getContext()); + } + + mProgressDialog.setMessage(message == null ? "" : message); + mProgressDialog.setIndeterminate(true); + mProgressDialog.show(); + } + + void dismissDialog() { + if (mProgressDialog != null) + mProgressDialog.dismiss(); + mProgressDialog = null; + } + + void connectNextClient() { + // do we already have all the clients we need? + int pendingClients = mRequestedClients & ~mConnectedClients; + if (pendingClients == 0) { + debugLog("All clients now connected. Sign-in successful."); + succeedSignIn(); + return; + } + + showProgressDialog(true); + + // which client should be the next one to connect? + if (mGamesClient != null && (0 != (pendingClients & CLIENT_GAMES))) { + debugLog("Connecting GamesClient."); + mClientCurrentlyConnecting = CLIENT_GAMES; + } else if (mPlusClient != null && (0 != (pendingClients & CLIENT_PLUS))) { + debugLog("Connecting PlusClient."); + mClientCurrentlyConnecting = CLIENT_PLUS; + } else if (mAppStateClient != null + && (0 != (pendingClients & CLIENT_APPSTATE))) { + debugLog("Connecting AppStateClient."); + mClientCurrentlyConnecting = CLIENT_APPSTATE; + } else { + throw new AssertionError( + "Not all clients connected, yet no one is next. R=" + + mRequestedClients + ", C=" + mConnectedClients); + } + + connectCurrentClient(); + } + + void connectCurrentClient() { + switch (mClientCurrentlyConnecting) { + case CLIENT_GAMES: + mGamesClient.connect(); + break; + case CLIENT_APPSTATE: + mAppStateClient.connect(); + break; + case CLIENT_PLUS: + mPlusClient.connect(); + break; + } + } + + void killConnections(int whatClients) { + if ((whatClients & CLIENT_GAMES) != 0 && mGamesClient != null + && mGamesClient.isConnected()) { + mConnectedClients &= ~CLIENT_GAMES; + mGamesClient.disconnect(); + } + if ((whatClients & CLIENT_PLUS) != 0 && mPlusClient != null + && mPlusClient.isConnected()) { + mConnectedClients &= ~CLIENT_PLUS; + mPlusClient.disconnect(); + } + if ((whatClients & CLIENT_APPSTATE) != 0 && mAppStateClient != null + && mAppStateClient.isConnected()) { + mConnectedClients &= ~CLIENT_APPSTATE; + mAppStateClient.disconnect(); + } + } + + public void reconnectClients(int whatClients) { + showProgressDialog(true); + + if ((whatClients & CLIENT_GAMES) != 0 && mGamesClient != null + && mGamesClient.isConnected()) { + mConnectedClients &= ~CLIENT_GAMES; + mGamesClient.reconnect(); + } + if ((whatClients & CLIENT_APPSTATE) != 0 && mAppStateClient != null + && mAppStateClient.isConnected()) { + mConnectedClients &= ~CLIENT_APPSTATE; + mAppStateClient.reconnect(); + } + if ((whatClients & CLIENT_PLUS) != 0 && mPlusClient != null + && mPlusClient.isConnected()) { + mConnectedClients &= ~CLIENT_PLUS; + mPlusClient.disconnect(); + mPlusClient.connect(); + } + } + + /** Called when we successfully obtain a connection to a client. */ + @Override + public void onConnected(Bundle connectionHint) { + debugLog("onConnected: connected! client=" + mClientCurrentlyConnecting); + + // Mark the current client as connected + mConnectedClients |= mClientCurrentlyConnecting; + + // If this was the games client and it came with an invite, store it for + // later retrieval. + if (mClientCurrentlyConnecting == CLIENT_GAMES + && connectionHint != null) { + debugLog("onConnected: connection hint provided. Checking for invite."); + Invitation inv = connectionHint + .getParcelable(GamesClient.EXTRA_INVITATION); + if (inv != null && inv.getInvitationId() != null) { + // accept invitation + debugLog("onConnected: connection hint has a room invite!"); + mInvitationId = inv.getInvitationId(); + debugLog("Invitation ID: " + mInvitationId); + } + } + + // connect the next client in line, if any. + connectNextClient(); + } + + void succeedSignIn() { + debugLog("All requested clients connected. Sign-in succeeded!"); + mSignedIn = true; + mSignInError = false; + mAutoSignIn = true; + dismissDialog(); + if (mListener != null) { + mListener.onSignInSucceeded(); + } + } + + /** Handles a connection failure reported by a client. */ + @Override + public void onConnectionFailed(ConnectionResult result) { + // save connection result for later reference + mConnectionResult = result; + debugLog("onConnectionFailed: result " + result.getErrorCode()); + dismissDialog(); + + if (!mUserInitiatedSignIn) { + // If the user didn't initiate the sign-in, we don't try to resolve + // the connection problem automatically -- instead, we fail and wait + // for the user to want to sign in. That way, they won't get an + // authentication (or other) popup unless they are actively trying + // to + // sign in. + debugLog("onConnectionFailed: since user didn't initiate sign-in, failing now."); + mConnectionResult = result; + if (mListener != null) { + mListener.onSignInFailed(); + } + return; + } + + debugLog("onConnectionFailed: since user initiated sign-in, trying to resolve problem."); + + // Resolve the connection result. This usually means showing a dialog or + // starting an Activity that will allow the user to give the appropriate + // consents so that sign-in can be successful. + resolveConnectionResult(); + } + + /** + * Attempts to resolve a connection failure. This will usually involve + * starting a UI flow that lets the user give the appropriate consents + * necessary for sign-in to work. + */ + void resolveConnectionResult() { + // Try to resolve the problem + debugLog("resolveConnectionResult: trying to resolve result: " + + mConnectionResult); + if (mConnectionResult.hasResolution()) { + // This problem can be fixed. So let's try to fix it. + debugLog("result has resolution. Starting it."); + try { + // launch appropriate UI flow (which might, for example, be the + // sign-in flow) + mExpectingActivityResult = true; + mConnectionResult.startResolutionForResult(mActivity, + RC_RESOLVE); + } catch (SendIntentException e) { + // Try connecting again + debugLog("SendIntentException."); + connectCurrentClient(); + } + } else { + // It's not a problem what we can solve, so give up and show an + // error. + debugLog("resolveConnectionResult: result has no resolution. Giving up."); + giveUp(); + } + } + + /** + * Give up on signing in due to an error. Shows the appropriate error + * message to the user, using a standard error dialog as appropriate to the + * cause of the error. That dialog will indicate to the user how the problem + * can be solved (for example, re-enable Google Play Services, upgrade to a + * new version, etc). + */ + void giveUp() { + mSignInError = true; + mAutoSignIn = false; + dismissDialog(); + debugLog("giveUp: giving up on connection. " + + ((mConnectionResult == null) ? "(no connection result)" + : ("Status code: " + mConnectionResult.getErrorCode()))); + + Dialog errorDialog = null; + if (mConnectionResult != null) { + // get error dialog for that specific problem + errorDialog = getErrorDialog(mConnectionResult.getErrorCode()); + errorDialog.show(); + if (mListener != null) { + mListener.onSignInFailed(); + } + } else { + // this is a bug + Log.e("GameHelper", "giveUp() called with no mConnectionResult"); + } + } + + /** Called when we are disconnected from a client. */ + @Override + public void onDisconnected() { + debugLog("onDisconnected."); + mConnectionResult = null; + mAutoSignIn = false; + mSignedIn = false; + mSignInError = false; + mInvitationId = null; + mConnectedClients = CLIENT_NONE; + if (mListener != null) { + mListener.onSignInFailed(); + } + } + + /** Returns an error dialog that's appropriate for the given error code. */ + Dialog getErrorDialog(int errorCode) { + debugLog("Making error dialog for error: " + errorCode); + Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode, + mActivity, RC_UNUSED, null); + + if (errorDialog != null) + return errorDialog; + + // as a last-resort, make a sad "unknown error" dialog. + return (new AlertDialog.Builder(getContext())) + .setMessage(mUnknownErrorMessage) + .setNeutralButton(android.R.string.ok, null).create(); + } + + void debugLog(String message) { + if (mDebugLog) + Log.d(mDebugTag, message); + } + + @Override + public void onSignOutComplete() { + dismissDialog(); + if (mGamesClient.isConnected()) + mGamesClient.disconnect(); + } +} diff --git a/shell/debug/google/src/com/google/games/basegameutils/GooglePlayGame.java b/shell/debug/google/src/com/google/games/basegameutils/GooglePlayGame.java new file mode 100755 index 000000000..6bd5b130d --- /dev/null +++ b/shell/debug/google/src/com/google/games/basegameutils/GooglePlayGame.java @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2013 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.games.basegameutils; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.google.android.gms.appstate.AppStateClient; +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.games.GamesClient; +import com.google.android.gms.plus.PlusClient; + +/** + * Example base class for games. This implementation takes care of setting up + * the GamesClient object and managing its lifecycle. Subclasses only need to + * override the @link{#onSignInSucceeded} and @link{#onSignInFailed} abstract + * methods. To initiate the sign-in flow when the user clicks the sign-in + * button, subclasses should call @link{#beginUserInitiatedSignIn}. By default, + * this class only instantiates the GamesClient object. If the PlusClient or + * AppStateClient objects are also wanted, call the BaseGameActivity(int) + * constructor and specify the requested clients. For example, to request + * PlusClient and GamesClient, use BaseGameActivity(CLIENT_GAMES | CLIENT_PLUS). + * To request all available clients, use BaseGameActivity(CLIENT_ALL). + * Alternatively, you can also specify the requested clients via + * + * @link{#setRequestedClients , but you must do so before @link{#onCreate} gets + * called, otherwise the call will have no effect. + * + * @author Bruno Oliveira (Google) + */ +public abstract class GooglePlayGame extends Activity implements + GameHelper.GameHelperListener { + + // The game helper object. This class is mainly a wrapper around this + // object. + protected GameHelper mHelper; + + // We expose these constants here because we don't want users of this class + // to have to know about GameHelper at all. + public static final int CLIENT_GAMES = GameHelper.CLIENT_GAMES; + public static final int CLIENT_APPSTATE = GameHelper.CLIENT_APPSTATE; + public static final int CLIENT_PLUS = GameHelper.CLIENT_PLUS; + public static final int CLIENT_ALL = GameHelper.CLIENT_ALL; + + // Requested clients. By default, that's just the games client. + protected int mRequestedClients = CLIENT_GAMES; + + /** Constructs a BaseGameActivity with default client (GamesClient). */ + protected GooglePlayGame() { + super(); + mHelper = new GameHelper(this); + } + + /** + * Constructs a BaseGameActivity with the requested clients. + * + * @param requestedClients + * The requested clients (a combination of CLIENT_GAMES, + * CLIENT_PLUS and CLIENT_APPSTATE). + */ + protected GooglePlayGame(int requestedClients) { + super(); + setRequestedClients(requestedClients); + } + + /** + * Sets the requested clients. The preferred way to set the requested + * clients is via the constructor, but this method is available if for some + * reason your code cannot do this in the constructor. This must be called + * before onCreate in order to have any effect. If called after onCreate, + * this method is a no-op. + * + * @param requestedClients + * A combination of the flags CLIENT_GAMES, CLIENT_PLUS and + * CLIENT_APPSTATE, or CLIENT_ALL to request all available + * clients. + */ + protected void setRequestedClients(int requestedClients) { + mRequestedClients = requestedClients; + } + + @Override + protected void onCreate(Bundle b) { + super.onCreate(b); + mHelper = new GameHelper(this); + mHelper.setup(this, mRequestedClients); + } + + @Override + protected void onStart() { + super.onStart(); + mHelper.onStart(this); + } + + @Override + protected void onStop() { + super.onStop(); + mHelper.onStop(); + } + + @Override + protected void onActivityResult(int request, int response, Intent data) { + super.onActivityResult(request, response, data); + mHelper.onActivityResult(request, response, data); + } + + protected GamesClient getGamesClient() { + return mHelper.getGamesClient(); + } + + protected AppStateClient getAppStateClient() { + return mHelper.getAppStateClient(); + } + + protected PlusClient getPlusClient() { + return mHelper.getPlusClient(); + } + + protected boolean isSignedIn() { + return mHelper.isSignedIn(); + } + + protected void beginUserInitiatedSignIn() { + mHelper.beginUserInitiatedSignIn(); + } + + protected void signOut() { + mHelper.signOut(); + } + + protected void showAlert(String title, String message) { + mHelper.showAlert(title, message); + } + + protected void showAlert(String message) { + mHelper.showAlert(message); + } + + protected void enableDebugLog(boolean enabled, String tag) { + mHelper.enableDebugLog(enabled, tag); + } + + protected String getInvitationId() { + return mHelper.getInvitationId(); + } + + protected void reconnectClients(int whichClients) { + mHelper.reconnectClients(whichClients); + } + + protected String getScopes() { + return mHelper.getScopes(); + } + + protected boolean hasSignInError() { + return mHelper.hasSignInError(); + } + + protected ConnectionResult getSignInError() { + return mHelper.getSignInError(); + } + + protected void setSignInMessages(String signingInMessage, + String signingOutMessage) { + mHelper.setSigningInMessage(signingInMessage); + mHelper.setSigningOutMessage(signingOutMessage); + } +} diff --git a/shell/debug/project.properties b/shell/debug/project.properties index 4ab125693..1b251ba3e 100644 --- a/shell/debug/project.properties +++ b/shell/debug/project.properties @@ -12,3 +12,4 @@ # Project target. target=android-19 +android.library.reference.1=google diff --git a/shell/debug/res/layout/dialog_message.xml b/shell/debug/res/layout/dialog_message.xml index b635d5675..ba0cbd8e8 100644 --- a/shell/debug/res/layout/dialog_message.xml +++ b/shell/debug/res/layout/dialog_message.xml @@ -74,8 +74,8 @@ android:id="@+id/debug_button" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="20dp" - android:layout_weight="1" + android:layout_marginTop="10dp" + android:layout_weight="0.25" android:text="@string/menu_debug" /> \ No newline at end of file diff --git a/shell/debug/res/layout/download_prog.xml b/shell/debug/res/layout/download_prog.xml new file mode 100755 index 000000000..5c7cf8654 --- /dev/null +++ b/shell/debug/res/layout/download_prog.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/shell/debug/res/values/donottranslate.xml b/shell/debug/res/values/donottranslate.xml index 44157d0b8..7ac5e3665 100644 --- a/shell/debug/res/values/donottranslate.xml +++ b/shell/debug/res/values/donottranslate.xml @@ -1,8 +1,8 @@ - reicast [LK Edition] + reicast debug - https://github.com/NoblesseOblige/reicast-emulator/issues/ - http://twisted.dyndns.tv:3194/Dreamcast/report/submit.php + https://github.com/reicast/reicast-emulator/issues/ + http://twisted.dyndns.tv:3194/ReicastBot/report/submit.php \ No newline at end of file diff --git a/shell/debug/res/values/strings.xml b/shell/debug/res/values/strings.xml index 1d657a011..54c41b76a 100644 --- a/shell/debug/res/values/strings.xml +++ b/shell/debug/res/values/strings.xml @@ -1,7 +1,5 @@ - reicast debug - Message Notifications Copying logcat content to clipboard\nPlease paste in the issue report diff --git a/shell/debug/src/com/reicast/emulator/debug/Debug.java b/shell/debug/src/com/reicast/emulator/debug/Debug.java index 39e350c59..89be95fcc 100644 --- a/shell/debug/src/com/reicast/emulator/debug/Debug.java +++ b/shell/debug/src/com/reicast/emulator/debug/Debug.java @@ -3,6 +3,7 @@ package com.reicast.emulator.debug; import java.io.BufferedReader; import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; @@ -44,6 +45,7 @@ import android.content.DialogInterface; import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; +import android.content.res.Resources; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; @@ -57,12 +59,10 @@ import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.CompoundButton; +import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; @@ -178,6 +178,20 @@ public class Debug extends Activity { generateErrorLog(); } }); + try { + Resources res = getPackageManager().getResourcesForApplication("com.reicast.emulator"); + InputStream file = res.getAssets().open("build"); + if (file != null) { + BufferedReader reader = new BufferedReader( + new InputStreamReader(file)); + Log.d("reicast-debug", "Hash: " + reader.readLine()); + file.close(); + } + } catch (IOException ioe) { + ioe.printStackTrace(); + } catch (NameNotFoundException e) { + e.printStackTrace(); + } } public void generateErrorLog() { diff --git a/shell/debug/src/com/reicast/emulator/debug/GitHash.java b/shell/debug/src/com/reicast/emulator/debug/GitHash.java new file mode 100644 index 000000000..b3447175e --- /dev/null +++ b/shell/debug/src/com/reicast/emulator/debug/GitHash.java @@ -0,0 +1,187 @@ +package com.reicast.emulator.debug; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; + +import android.app.Activity; +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.os.AsyncTask; +import android.os.Build; +import android.os.Bundle; +import android.support.v4.app.NotificationCompat; +import android.util.Log; +import android.widget.RemoteViews; +import android.widget.Toast; + +public class GitHash extends Activity { + + private Context mContext; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + mContext = this.getApplicationContext(); + Bundle extras = getIntent().getExtras(); + if (extras != null) { + String hash = extras.getString("hashtag"); + NetworkHandler mDownload = new NetworkHandler(mContext); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + mDownload.executeOnExecutor( + AsyncTask.THREAD_POOL_EXECUTOR, hash); + } else { + mDownload.execute(hash); + } + } + } + + public class NetworkHandler extends AsyncTask { + + private Context mContext; + private NotificationManager mNM; + private Notification notification; + private int progress = 0; + private String hash; + + short timestamp = (short) System.currentTimeMillis(); + + NetworkHandler(Context mContext) { + this.mContext = mContext; + mNM = (NotificationManager) mContext + .getSystemService(NOTIFICATION_SERVICE); + } + + @Override + protected File doInBackground(String... paths) { + String apk = "reicast-emulator-" + paths[0] + ".apk"; + String file = "http://twisted.dyndns.tv:3194/ReicastBot/compiled/" + apk; + File SDCard = mContext.getExternalCacheDir(); + File apkFile = new File(SDCard, apk); + try { + URL url = new URL(file); + HttpURLConnection urlConnection = (HttpURLConnection) url + .openConnection(); + HttpURLConnection.setFollowRedirects(true); + urlConnection.setRequestMethod("GET"); + urlConnection.setDoOutput(true); + urlConnection.connect(); + FileOutputStream fileOutput = new FileOutputStream(apkFile); + InputStream inputStream = urlConnection.getInputStream(); + int totalSize = urlConnection.getContentLength(); + int downloadedSize = 0; + byte[] buffer = new byte[1024]; + int bufferLength = 0; + int priorProgress = 0; + while ((bufferLength = inputStream.read(buffer)) > 0) { + downloadedSize += bufferLength; + int currentSize = (int) (downloadedSize * 100 / totalSize); + if (currentSize > priorProgress) { + priorProgress = (int) (downloadedSize * 100 / totalSize); + publishProgress(currentSize); + } + fileOutput.write(buffer, 0, bufferLength); + } + fileOutput.close(); + inputStream.close(); + return apkFile.getAbsoluteFile(); + } catch (MalformedURLException e) { + Log.d(Debug.APP_TAG, "MalformedURLException: " + e.getMessage()); + } catch (IOException e) { + Log.d(Debug.APP_TAG, "IOException: " + e.getMessage()); + } catch (Exception e) { + Log.d(Debug.APP_TAG, "Exception: " + e.getMessage()); + } + return null; + } + + @Override + protected void onProgressUpdate(Integer... progress) { + notification.contentView.setProgressBar(R.id.status_progress, 100, + progress[0], false); + mNM.notify(timestamp, notification); + } + + @Override + protected void onPreExecute() { + Intent intent = new Intent(mContext, GitHash.class); + final PendingIntent pendingIntent = PendingIntent.getActivity( + mContext.getApplicationContext(), 0, intent, 0); + NotificationCompat.Builder builder = new NotificationCompat.Builder( + mContext.getApplicationContext()); + builder.setContentTitle("reicast " + hash) + .setSmallIcon(R.drawable.ic_launcher) + .setAutoCancel(false).setOngoing(true) + .setPriority(Notification.PRIORITY_HIGH); + notification = builder.build(); + notification.flags |= Notification.FLAG_NO_CLEAR; + notification.contentView = new RemoteViews(mContext + .getApplicationContext().getPackageName(), + R.layout.download_prog); + notification.contentIntent = pendingIntent; + notification.contentView.setImageViewResource(R.id.status_icon, + R.drawable.ic_launcher); + notification.contentView.setTextViewText(R.id.status_text, "Downloading " + hash + "..."); + notification.contentView.setProgressBar(R.id.status_progress, 100, + progress, false); + mNM.notify(timestamp, notification); + // Use a resourceId as an unique identifier + } + + @Override + protected void onPostExecute(File download) { + mNM.cancel(timestamp); + if (download != null) { + System.gc(); + Intent installIntent; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + installIntent = new Intent(Intent.ACTION_INSTALL_PACKAGE); + installIntent.setData(Uri.fromFile(download)); + installIntent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, + true); + installIntent.putExtra(Intent.EXTRA_RETURN_RESULT, true); + installIntent.putExtra(Intent.EXTRA_ALLOW_REPLACE, true); + installIntent.putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME, + getApplicationInfo().packageName); + } else { + installIntent = new Intent(Intent.ACTION_VIEW); + installIntent.setDataAndType(Uri.fromFile(download), + "application/vnd.android.package-archive"); + } + startActivityForResult(installIntent, 0); + } else { + Toast.makeText(mContext, "Download Unavailable!", Toast.LENGTH_SHORT).show(); + finish(); + } + } + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + finish(); + } + + @Override + protected void onPause() { + super.onPause(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } + + @Override + protected void onResume() { + super.onResume(); + } +}