From f0f02665966df03f0a54a2528db560b07c0fbca2 Mon Sep 17 00:00:00 2001 From: "Jason J." Date: Tue, 7 Oct 2014 18:12:41 -0400 Subject: [PATCH] [Rea][Ref]: Renamed all variables to be shorter for readablity Renamed variables that started "com_ovrhere_currConv_..." to just "currConv_..." or "currconv_...". --- res/layout-w720dp/fragment_main.xml | 6 +- res/layout/fragment_currency_value.xml | 16 ++--- res/layout/fragment_main.xml | 8 +-- res/layout/viewstub_main_input_views.xml | 68 +++++++++---------- res/values-normal/limits.xml | 2 +- res/values-small-land/limits.xml | 2 +- res/values-w320dp/limits.xml | 2 +- res/values/colors.xml | 16 ++--- res/values/currency_codes_symbols.xml | 20 +++--- res/values/default_exchange_rates.xml | 34 +++++----- res/values/dimens.xml | 18 ++--- res/values/limits.xml | 2 +- res/values/preference_info.xml | 30 ++++---- res/values/strings.xml | 26 +++---- res/values/styles.xml | 8 +-- res/values/update_periods.xml | 2 +- res/xml/settings.xml | 2 +- .../model/CurrencyExchangeRateAsyncModel.java | 46 ++++++------- .../model/FlagResourceMap.java | 10 +-- .../prefs/PreferenceUtils.java | 18 ++--- .../CurrencyDataFilterListAdapter.java | 20 +++--- .../adapters/CurrencyDataSpinnerAdapter.java | 2 +- .../ui/fragments/MainFragment.java | 48 ++++++------- .../ui/fragments/SettingsFragment.java | 6 +- 24 files changed, 206 insertions(+), 206 deletions(-) diff --git a/res/layout-w720dp/fragment_main.xml b/res/layout-w720dp/fragment_main.xml index cac0654..322296f 100755 --- a/res/layout-w720dp/fragment_main.xml +++ b/res/layout-w720dp/fragment_main.xml @@ -25,17 +25,17 @@ android:baselineAligned="false" > - diff --git a/res/layout/fragment_currency_value.xml b/res/layout/fragment_currency_value.xml index 5dd4b6a..79aa998 100755 --- a/res/layout/fragment_currency_value.xml +++ b/res/layout/fragment_currency_value.xml @@ -16,7 +16,7 @@ --> diff --git a/res/layout/fragment_main.xml b/res/layout/fragment_main.xml index 45ccf4a..7971411 100755 --- a/res/layout/fragment_main.xml +++ b/res/layout/fragment_main.xml @@ -22,16 +22,16 @@ android:paddingTop="@dimen/activity_vertical_margin" > - + android:layout_marginTop="@dimen/currConv_main_listView_topPadding" + android:cacheColorHint="@color/currconv_listFade" /> diff --git a/res/layout/viewstub_main_input_views.xml b/res/layout/viewstub_main_input_views.xml index e2c66e9..fd15b8e 100755 --- a/res/layout/viewstub_main_input_views.xml +++ b/res/layout/viewstub_main_input_views.xml @@ -21,94 +21,94 @@ > - + android:layout_marginTop="@dimen/currConv_main_destSpinner_topPadding" /> diff --git a/res/values-normal/limits.xml b/res/values-normal/limits.xml index 9ab5276..97a5a56 100755 --- a/res/values-normal/limits.xml +++ b/res/values-normal/limits.xml @@ -19,6 +19,6 @@ This is the setting for LARGER devices --> - 1 diff --git a/res/values-small-land/limits.xml b/res/values-small-land/limits.xml index 9ab5276..97a5a56 100755 --- a/res/values-small-land/limits.xml +++ b/res/values-small-land/limits.xml @@ -19,6 +19,6 @@ This is the setting for LARGER devices --> - 1 diff --git a/res/values-w320dp/limits.xml b/res/values-w320dp/limits.xml index 9ab5276..97a5a56 100755 --- a/res/values-w320dp/limits.xml +++ b/res/values-w320dp/limits.xml @@ -19,6 +19,6 @@ This is the setting for LARGER devices --> - 1 diff --git a/res/values/colors.xml b/res/values/colors.xml index 696ea21..9652355 100755 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -16,23 +16,23 @@ --> - #080808 + #080808 - #e8f6f7 + #e8f6f7 - - #333 + + #333 - @color/com_ovrhere_currConv_background + @color/currconv_background - #aa1111 + #aa1111 - #99c6f1f4 + #99c6f1f4 - #0fff + #0fff diff --git a/res/values/currency_codes_symbols.xml b/res/values/currency_codes_symbols.xml index ddd26cf..946cda9 100755 --- a/res/values/currency_codes_symbols.xml +++ b/res/values/currency_codes_symbols.xml @@ -30,28 +30,28 @@ - USD + USD - CAD + CAD - EUR + EUR - GBP + GBP - JPY + JPY - $ + $ - $ + $ - + - £ + £ - ¥ + ¥ diff --git a/res/values/default_exchange_rates.xml b/res/values/default_exchange_rates.xml index 834ac87..e336ed2 100755 --- a/res/values/default_exchange_rates.xml +++ b/res/values/default_exchange_rates.xml @@ -21,20 +21,20 @@ - 2014-09-08 19:08:14.000+0000 - - @string/com_ovrhere_currConv_USD_code - @string/com_ovrhere_currConv_CAD_code - @string/com_ovrhere_currConv_EUR_code - @string/com_ovrhere_currConv_GBP_code - @string/com_ovrhere_currConv_JPY_code + + @string/currConv_USD_code + @string/currConv_CAD_code + @string/currConv_EUR_code + @string/currConv_GBP_code + @string/currConv_JPY_code - - + + 1.00 1.0967 0.7750 @@ -42,8 +42,8 @@ 105.9535 - - + + 0.9118 1.00 0.7067 @@ -52,8 +52,8 @@ - - + + 1.2903 1.4151 1.00 @@ -62,8 +62,8 @@ - - + + 1.6116 1.7675 1.2490 @@ -72,8 +72,8 @@ - - + + 0.0094 0.0104 0.0073 diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 2f0d984..832ebe3 100755 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -24,26 +24,26 @@ - 5dp + 5dp - 13dp + 13dp - 6dp + 6dp - 10dp + 10dp - 120dp + 120dp - 50dp + 50dp - @dimen/com_ovrhere_currConv_main_sourceFlag_width + @dimen/currConv_main_sourceFlag_width - 100dp diff --git a/res/values/limits.xml b/res/values/limits.xml index 6b4c3d2..6ed34aa 100755 --- a/res/values/limits.xml +++ b/res/values/limits.xml @@ -20,6 +20,6 @@ - 0 diff --git a/res/values/preference_info.xml b/res/values/preference_info.xml index 63bfa4e..d69e0b6 100755 --- a/res/values/preference_info.xml +++ b/res/values/preference_info.xml @@ -15,51 +15,51 @@ limitations under the License. --> - + - + com_ovrhere_currConv_PREFERENCE_FILE_KEY - + - + com_ovrhere_currConv_pref_KEY_SOURCE_CURRENCY_INDEX - + com_ovrhere_currConv_pref_KEY_DEST_CURRENCY_INDEX - + com_ovrhere_currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL - + com_ovrhere_currConv_pref_KEY_USE_JSON_REQUEST - - + 0 - - + 0 - - 3600000 - - + 1 diff --git a/res/values/strings.xml b/res/values/strings.xml index b47d5f3..5e7a6bd 100755 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -24,43 +24,43 @@ - + Warning: Using cached values (fetched %1$s). Results accuracy may vary. - + Action on "%1$s" - + View All - + Copied Currency - + Detailed copy - United States Dollar - Canadian Dollar - Euro - Great British Pound - Japanese Yen @@ -87,21 +87,21 @@ - + 0 hours ago 1 hour ago %d hours ago - + 0 minutes ago 1 minute ago %d minutes ago - + 0 days ago 1 day ago %d days ago diff --git a/res/values/styles.xml b/res/values/styles.xml index 273bc3d..f547cac 100755 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -29,7 +29,7 @@ diff --git a/res/values/update_periods.xml b/res/values/update_periods.xml index 9ca7d4c..a381d87 100755 --- a/res/values/update_periods.xml +++ b/res/values/update_periods.xml @@ -33,7 +33,7 @@ - @integer/com_ovrhere_currConv_pref_DEF_VALUE_UPDATE_CURRENCY_INTERVAL + @integer/currConv_pref_DEF_VALUE_UPDATE_CURRENCY_INTERVAL diff --git a/res/xml/settings.xml b/res/xml/settings.xml index babdc9f..bd61a1a 100755 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -28,7 +28,7 @@ /> diff --git a/src/com/ovrhere/android/currencyconverter/model/CurrencyExchangeRateAsyncModel.java b/src/com/ovrhere/android/currencyconverter/model/CurrencyExchangeRateAsyncModel.java index 2231aa0..5e1a722 100755 --- a/src/com/ovrhere/android/currencyconverter/model/CurrencyExchangeRateAsyncModel.java +++ b/src/com/ovrhere/android/currencyconverter/model/CurrencyExchangeRateAsyncModel.java @@ -151,7 +151,7 @@ public CurrencyExchangeRateAsyncModel(FragmentActivity activity) { this.res = activity.getResources(); this.currencyCodeList.addAll( Arrays.asList( - res.getStringArray(R.array.com_ovrhere_currConv_rateOrder)) + res.getStringArray(R.array.currConv_rateOrder)) ); mfragManager = activity.getSupportFragmentManager(); //prepare the headless fragment in advance. @@ -255,7 +255,7 @@ private void requestApiValues(List records){ isUpdating = true; //the lazy approach usingJson = prefs.getBoolean( - res.getString(R.string.com_ovrhere_currConv_pref_KEY_USE_JSON_REQUEST), + res.getString(R.string.currConv_pref_KEY_USE_JSON_REQUEST), false); if (records.isEmpty()){ @@ -306,38 +306,38 @@ private boolean initDefaultDatabase(){ notifyHandlers(NOTIFY_INITIALIZING_DATABASE, null); mLocalModel.insertRecord( createCurrencyData( - R.string.com_ovrhere_currConv_USD_symbol, - R.string.com_ovrhere_currConv_USD_code, - R.string.com_ovrhere_currConv_USD_name, - R.array.com_ovrhere_currConv_USD_defRates) + R.string.currConv_USD_symbol, + R.string.currConv_USD_code, + R.string.currConv_USD_name, + R.array.currConv_USD_defRates) ); mLocalModel.insertRecord( createCurrencyData( - R.string.com_ovrhere_currConv_CAD_symbol, - R.string.com_ovrhere_currConv_CAD_code, - R.string.com_ovrhere_currConv_CAD_name, - R.array.com_ovrhere_currConv_CAD_defRates) + R.string.currConv_CAD_symbol, + R.string.currConv_CAD_code, + R.string.currConv_CAD_name, + R.array.currConv_CAD_defRates) ); mLocalModel.insertRecord( createCurrencyData( - R.string.com_ovrhere_currConv_EUR_symbol, - R.string.com_ovrhere_currConv_EUR_code, - R.string.com_ovrhere_currConv_EUR_name, - R.array.com_ovrhere_currConv_EUR_defRates) + R.string.currConv_EUR_symbol, + R.string.currConv_EUR_code, + R.string.currConv_EUR_name, + R.array.currConv_EUR_defRates) ); mLocalModel.insertRecord( createCurrencyData( - R.string.com_ovrhere_currConv_GBP_symbol, - R.string.com_ovrhere_currConv_GBP_code, - R.string.com_ovrhere_currConv_GBP_name, - R.array.com_ovrhere_currConv_GBP_defRates) + R.string.currConv_GBP_symbol, + R.string.currConv_GBP_code, + R.string.currConv_GBP_name, + R.array.currConv_GBP_defRates) ); mLocalModel.insertRecord( createCurrencyData( - R.string.com_ovrhere_currConv_JPY_symbol, - R.string.com_ovrhere_currConv_JPY_code, - R.string.com_ovrhere_currConv_JPY_name, - R.array.com_ovrhere_currConv_JPY_defRates) + R.string.currConv_JPY_symbol, + R.string.currConv_JPY_code, + R.string.currConv_JPY_name, + R.array.currConv_JPY_defRates) ); } catch (ParseException e) { Log.e(LOGTAG, "Float parse error occurred"); @@ -382,7 +382,7 @@ private CurrencyData createCurrencyData(int symbolId, int codeId, int nameId, res.getString(codeId), res.getString(nameId)) .setModifiedTimestamp( - res.getString(R.string.com_ovrhere_currConv_defRate_updateTime) + res.getString(R.string.currConv_defRate_updateTime) ) .setExchangeRates(exchangeRates); diff --git a/src/com/ovrhere/android/currencyconverter/model/FlagResourceMap.java b/src/com/ovrhere/android/currencyconverter/model/FlagResourceMap.java index 02d7366..50c60b5 100755 --- a/src/com/ovrhere/android/currencyconverter/model/FlagResourceMap.java +++ b/src/com/ovrhere/android/currencyconverter/model/FlagResourceMap.java @@ -61,23 +61,23 @@ static public boolean setCurrencyFlagDrawable(Resources res, CurrencyData data){ /** Initializes the flag resources. */ static private void initFlagMap(Resources res){ flagMap.put( - res.getString(R.string.com_ovrhere_currConv_CAD_code) + res.getString(R.string.currConv_CAD_code) .toLowerCase(Locale.US), R.drawable.ic_flag_cad); flagMap.put( - res.getString(R.string.com_ovrhere_currConv_EUR_code) + res.getString(R.string.currConv_EUR_code) .toLowerCase(Locale.US), R.drawable.ic_flag_eur); flagMap.put( - res.getString(R.string.com_ovrhere_currConv_GBP_code) + res.getString(R.string.currConv_GBP_code) .toLowerCase(Locale.US), R.drawable.ic_flag_gbp); flagMap.put( - res.getString(R.string.com_ovrhere_currConv_JPY_code) + res.getString(R.string.currConv_JPY_code) .toLowerCase(Locale.US), R.drawable.ic_flag_jpy); flagMap.put( - res.getString(R.string.com_ovrhere_currConv_USD_code) + res.getString(R.string.currConv_USD_code) .toLowerCase(Locale.US), R.drawable.ic_flag_usd); } diff --git a/src/com/ovrhere/android/currencyconverter/prefs/PreferenceUtils.java b/src/com/ovrhere/android/currencyconverter/prefs/PreferenceUtils.java index d561f1a..8f5fc8b 100755 --- a/src/com/ovrhere/android/currencyconverter/prefs/PreferenceUtils.java +++ b/src/com/ovrhere/android/currencyconverter/prefs/PreferenceUtils.java @@ -55,7 +55,7 @@ static public SharedPreferences getPreferences(Context context){ * and thus will not leak. */ context = context.getApplicationContext(); return context.getSharedPreferences( - context.getResources().getString(R.string.com_ovrhere_currConv_PREFERENCE_FILE_KEY), + context.getResources().getString(R.string.currConv_PREFERENCE_FILE_KEY), Context.MODE_PRIVATE); } @@ -80,21 +80,21 @@ static public void setToDefault(Context context){ static private void _setDefaults(Resources r, SharedPreferences.Editor prefEdit){ //Thought: Consider using parallel arrays in res to respect open-close? prefEdit.putInt( - r.getString(R.string.com_ovrhere_currConv_pref_KEY_SOURCE_CURRENCY_INDEX), - r.getInteger(R.integer.com_ovrhere_currConv_pref_DEF_VALUE_SOURCE_CURRENCY_INDEX) + r.getString(R.string.currConv_pref_KEY_SOURCE_CURRENCY_INDEX), + r.getInteger(R.integer.currConv_pref_DEF_VALUE_SOURCE_CURRENCY_INDEX) ); prefEdit.putInt( - r.getString(R.string.com_ovrhere_currConv_pref_KEY_DEST_CURRENCY_INDEX), - r.getInteger(R.integer.com_ovrhere_currConv_pref_DEF_VALUE_DEST_CURRENCY_INDEX) + r.getString(R.string.currConv_pref_KEY_DEST_CURRENCY_INDEX), + r.getInteger(R.integer.currConv_pref_DEF_VALUE_DEST_CURRENCY_INDEX) ); prefEdit.putInt( - r.getString(R.string.com_ovrhere_currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL), - r.getInteger(R.integer.com_ovrhere_currConv_pref_DEF_VALUE_UPDATE_CURRENCY_INTERVAL) + r.getString(R.string.currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL), + r.getInteger(R.integer.currConv_pref_DEF_VALUE_UPDATE_CURRENCY_INTERVAL) ); prefEdit.putBoolean( - r.getString(R.string.com_ovrhere_currConv_pref_KEY_USE_JSON_REQUEST), - r.getBoolean(R.bool.com_ovrhere_currConv_pref_DEF_VALUE_USE_JSON_REQUEST) + r.getString(R.string.currConv_pref_KEY_USE_JSON_REQUEST), + r.getBoolean(R.bool.currConv_pref_DEF_VALUE_USE_JSON_REQUEST) ); //first run has completed. diff --git a/src/com/ovrhere/android/currencyconverter/ui/adapters/CurrencyDataFilterListAdapter.java b/src/com/ovrhere/android/currencyconverter/ui/adapters/CurrencyDataFilterListAdapter.java index 88b37bb..ae7afb1 100755 --- a/src/com/ovrhere/android/currencyconverter/ui/adapters/CurrencyDataFilterListAdapter.java +++ b/src/com/ovrhere/android/currencyconverter/ui/adapters/CurrencyDataFilterListAdapter.java @@ -69,10 +69,10 @@ public class CurrencyDataFilterListAdapter extends BaseAdapter * @param context The current context * @param resource The layout resource to use. Expected to contain ids: *
    - *
  • com_ovrhere_currConv_frag_currVal_text_symbol
  • - *
  • com_ovrhere_currConv_frag_currVal_text_currValue
  • - *
  • com_ovrhere_currConv_frag_currVal_img_currFlag
  • - *
  • com_ovrhere_currConv_frag_currVal_text_currCode
  • + *
  • currConv_frag_currVal_text_symbol
  • + *
  • currConv_frag_currVal_text_currValue
  • + *
  • currConv_frag_currVal_img_currFlag
  • + *
  • currConv_frag_currVal_text_currCode
  • *
*/ public CurrencyDataFilterListAdapter(Context context, int resource) { @@ -174,13 +174,13 @@ public View getView(int position, View convertView, ViewGroup parent) { holder = new Holder(); holder.symbol = (TextView) - convertView.findViewById(R.id.com_ovrhere_currConv_frag_currVal_text_symbol); + convertView.findViewById(R.id.currConv_frag_currVal_text_symbol); holder.value = (TextView) - convertView.findViewById(R.id.com_ovrhere_currConv_frag_currVal_text_currValue); + convertView.findViewById(R.id.currConv_frag_currVal_text_currValue); holder.flag = (ImageView) - convertView.findViewById(R.id.com_ovrhere_currConv_frag_currVal_img_currFlag); + convertView.findViewById(R.id.currConv_frag_currVal_img_currFlag); holder.code = (TextView) - convertView.findViewById(R.id.com_ovrhere_currConv_frag_currVal_text_currCode); + convertView.findViewById(R.id.currConv_frag_currVal_text_currCode); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); @@ -211,8 +211,8 @@ private class Holder { static void setRowColour(View convertView, int position){ int color = convertView.getResources().getColor( position % 2 == 1 ? //zero-indexed - R.color.com_ovrhere_currConv_outputEven : - R.color.com_ovrhere_currConv_outputOdd); + R.color.currconv_outputEven : + R.color.currconv_outputOdd); convertView.setBackgroundColor(color); } diff --git a/src/com/ovrhere/android/currencyconverter/ui/adapters/CurrencyDataSpinnerAdapter.java b/src/com/ovrhere/android/currencyconverter/ui/adapters/CurrencyDataSpinnerAdapter.java index 9ad071b..286fc06 100755 --- a/src/com/ovrhere/android/currencyconverter/ui/adapters/CurrencyDataSpinnerAdapter.java +++ b/src/com/ovrhere/android/currencyconverter/ui/adapters/CurrencyDataSpinnerAdapter.java @@ -200,7 +200,7 @@ private View getPopulatedView(int position, View convertView, drawablePadding = convertView.getResources() .getDimensionPixelSize( - R.dimen.com_ovrhere_currConv_main_spinner_imgPadding); + R.dimen.currConv_main_spinner_imgPadding); } } else { text = data.getCurrencyCode(); diff --git a/src/com/ovrhere/android/currencyconverter/ui/fragments/MainFragment.java b/src/com/ovrhere/android/currencyconverter/ui/fragments/MainFragment.java index 366aee8..3256a39 100755 --- a/src/com/ovrhere/android/currencyconverter/ui/fragments/MainFragment.java +++ b/src/com/ovrhere/android/currencyconverter/ui/fragments/MainFragment.java @@ -162,11 +162,11 @@ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); dateResUnits.put(DateFormatter.MINUTE_UNIT, - R.plurals.com_ovrhere_currConv_minutes); + R.plurals.currConv_minutes); dateResUnits.put(DateFormatter.HOUR_UNIT, - R.plurals.com_ovrhere_currConv_hours); + R.plurals.currConv_hours); dateResUnits.put(DateFormatter.DAY_UNIT, - R.plurals.com_ovrhere_currConv_days); + R.plurals.currConv_days); if (PreferenceUtils.isFirstRun(getActivity())){ PreferenceUtils.setToDefault(getActivity()); @@ -210,19 +210,19 @@ public void onDestroyView() { @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { - if (v.getId()==R.id.com_ovrhere_currConv_main_listView) { + if (v.getId()==R.id.currConv_main_listView) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo; CurrencyData currency = outputListAdapter.getItem(info.position); if (currency != null){ String title = getString( - R.string.com_ovrhere_currConv_context_currencyAction, + R.string.currConv_context_currencyAction, currency.getCurrencyCode()); menu.setHeaderTitle(title); menu.add(Menu.CATEGORY_SECONDARY, 0, 0, android.R.string.copy); menu.add(Menu.CATEGORY_SECONDARY, 1, 1, - R.string.com_ovrhere_currConv_context_detailedCopy); + R.string.currConv_context_detailedCopy); } } } @@ -286,11 +286,11 @@ public void processStateForRates(Bundle savedInstanceState) { private void processSavedState(Bundle savedInstanceState) { int sourceCurrSelect = prefs.getInt( - getString(R.string.com_ovrhere_currConv_pref_KEY_SOURCE_CURRENCY_INDEX), + getString(R.string.currConv_pref_KEY_SOURCE_CURRENCY_INDEX), 0); int destCurrSelect = prefs.getInt( - getString(R.string.com_ovrhere_currConv_pref_KEY_DEST_CURRENCY_INDEX), + getString(R.string.currConv_pref_KEY_DEST_CURRENCY_INDEX), 0); sp_sourceCurr.setSelection(sourceCurrSelect); @@ -315,25 +315,25 @@ private void processSavedState(Bundle savedInstanceState) { * @see #initAdapters() */ private void initOutputViews(View rootView) { ListView outputListView = (ListView) - rootView.findViewById(R.id.com_ovrhere_currConv_main_listView); + rootView.findViewById(R.id.currConv_main_listView); outputListView.setAdapter(outputListAdapter); outputListView.setOnItemLongClickListener(this); registerForContextMenu(outputListView); updateProgressSpin = - rootView.findViewById(R.id.com_ovrhere_currConv_main_progressSpin); + rootView.findViewById(R.id.currConv_main_progressSpin); checkProgressBar(); tv_currSymbol = (TextView) - rootView.findViewById(R.id.com_ovrhere_currConv_main_text_currSymbol); + rootView.findViewById(R.id.currConv_main_text_currSymbol); tv_warning = (TextView) - rootView.findViewById(R.id.com_ovrhere_currConv_main_text_warning); + rootView.findViewById(R.id.currConv_main_text_warning); img_currFlag = (ImageView) - rootView.findViewById(R.id.com_overhere_currConv_main_image_currFlag); + rootView.findViewById(R.id.currConv_main_image_currFlag); //show or hide flags, depending on bool. boolean showFlags = - getResources().getBoolean(R.bool.com_ovrhere_currConv_showFlags); + getResources().getBoolean(R.bool.currconv_showflags); img_currFlag.setVisibility(showFlags ? View.VISIBLE : View.GONE); } @@ -342,17 +342,17 @@ private void initOutputViews(View rootView) { * @see #initAdapters() */ private void initInputViews(View rootView) { sp_sourceCurr = (Spinner) - rootView.findViewById(R.id.com_ovrhere_currConv_main_spinner_currencySource); + rootView.findViewById(R.id.currConv_main_spinner_currencySource); sp_sourceCurr.setAdapter(sourceCurrAdapter); sp_sourceCurr.setOnItemSelectedListener(sourceItemSelectedListener); sp_destCurr = (Spinner) - rootView.findViewById(R.id.com_ovrhere_currConv_main_spinner_currencyDest); + rootView.findViewById(R.id.currConv_main_spinner_currencyDest); sp_destCurr.setAdapter(destCurrAdapter); sp_destCurr.setOnItemSelectedListener(destItemSelectListener); et_currInput = (EditText) - rootView.findViewById(R.id.com_ovrhere_currConv_main_edittext_valueToConv); + rootView.findViewById(R.id.currConv_main_edittext_valueToConv); et_currInput.addTextChangedListener(valueInputListener); } /** Initializes adapters for output list and spinners. */ @@ -366,7 +366,7 @@ private void initAdapters() { new CurrencyDataSpinnerAdapter(getActivity(), android.R.layout.simple_list_item_1, true); destCurrAdapter.setSelectAllText( - getString(R.string.com_ovrhere_currConv_spinner_dest_selectAll)); + getString(R.string.currConv_spinner_dest_selectAll)); } @@ -455,7 +455,7 @@ private void copyConvertedValue(int position, boolean detailed) { +" "+destCurrency.getCurrencyCode(); String label = getString( - R.string.com_ovrhere_currConv_clipboard_label_copiedCurrency); + R.string.currConv_clipboard_label_copiedCurrency); CompatClipboard.copyToClipboard(getActivity(), label, value); } } @@ -473,7 +473,7 @@ private void checkProgressBar(){ private void checkTimestampToUpdate(CurrencyData currencyData) { long updateInterval = prefs.getInt( getString( - R.string.com_ovrhere_currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL), + R.string.currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL), 0); long interval = new Date().getTime() - currencyData.getModifiedDate().getTime(); @@ -490,7 +490,7 @@ private void checkTimestampToUpdate(CurrencyData currencyData) { private void checkTimestampWarning(CurrencyData currencyData) { long updateInterval = prefs.getInt( getString( - R.string.com_ovrhere_currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL), + R.string.currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL), 0); long interval = new Date().getTime() - currencyData.getModifiedDate().getTime(); @@ -499,7 +499,7 @@ private void checkTimestampWarning(CurrencyData currencyData) { getActivity(), dateResUnits, currencyData.getModifiedDate()); tv_warning.setText( - getString(R.string.com_ovrhere_currConv_cachedRate_warning, + getString(R.string.currConv_cachedRate_warning, timestamp) ); tv_warning.setVisibility(View.VISIBLE); @@ -588,7 +588,7 @@ public void onItemSelected(android.widget.AdapterView parent, calculateOutput(et_currInput.getText().toString()); } putIntPref( - R.string.com_ovrhere_currConv_pref_KEY_SOURCE_CURRENCY_INDEX, + R.string.currConv_pref_KEY_SOURCE_CURRENCY_INDEX, position); }; @Override @@ -610,7 +610,7 @@ public void onItemSelected(android.widget.AdapterView parent, new String[]{data.getCurrencyCode()}); } putIntPref( - R.string.com_ovrhere_currConv_pref_KEY_DEST_CURRENCY_INDEX, + R.string.currConv_pref_KEY_DEST_CURRENCY_INDEX, position); }; @Override diff --git a/src/com/ovrhere/android/currencyconverter/ui/fragments/SettingsFragment.java b/src/com/ovrhere/android/currencyconverter/ui/fragments/SettingsFragment.java index df51268..6bdbd28 100755 --- a/src/com/ovrhere/android/currencyconverter/ui/fragments/SettingsFragment.java +++ b/src/com/ovrhere/android/currencyconverter/ui/fragments/SettingsFragment.java @@ -68,7 +68,7 @@ public class SettingsFragment extends PreferenceFragment public void onCreate(Bundle paramBundle) { super.onCreate(paramBundle); getPreferenceManager().setSharedPreferencesName( - getString(R.string.com_ovrhere_currConv_PREFERENCE_FILE_KEY)); + getString(R.string.currConv_PREFERENCE_FILE_KEY)); prefs = getPreferenceManager().getSharedPreferences(); tm = new ToastManager(getActivity()); @@ -116,7 +116,7 @@ private void refreshPreferences(){ /** Initializes the update interval, including label. */ private void initUpdateInterval(){ final String prefKey = getString( - R.string.com_ovrhere_currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL); + R.string.currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL); final String settingKey = getString(R.string.currConv_settings_KEY_UPDATE_INTERVAL); @@ -251,7 +251,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { int value = Integer.parseInt((String)newValue); prefs.edit() .putInt( - getString(R.string.com_ovrhere_currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL), + getString(R.string.currConv_pref_KEY_UPDATE_CURRENCY_INTERVAL), value) .commit(); findAndSetUpdateSummary(value, (ListPreference) preference);