Commits

M Haidar Hanif committed a45ec6d

Large scale update for dependency and string names

Target SDK to 4.1.1.4 to match with Maven repository.
Require minimun API level 11 to use ActionBar API.
Refactor most of string names based on type_identity.

  • Participants
  • Parent commits 8a9fa51

Comments (0)

Files changed (7)

File AndroidManifest.xml

         android:debuggable="true"
         android:allowBackup="true"
         android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
+        android:label="@string/name_app"
         android:theme="@style/AppTheme">
 
         <activity
             android:name=".MainActivity"
-            android:label="@string/app_name"
+            android:label="@string/name_app"
             android:launchMode="singleTask">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
         <activity
             android:name=".AboutDialogActivity"
-            android:label="@string/about_title"
+            android:label="@string/title_about"
             android:theme="@android:style/Theme.Dialog">
         </activity>
 
     <url>https://github.com/mhaidarh/kargu/</url>
 
     <properties>
-        <platform.version> 2.3.3
+        <platform.version> 4.1.1.4
         </platform.version>
     </properties>
 
             <version>${platform.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>com.google.android</groupId>
+            <artifactId>support-v4</artifactId>
+            <version>r7</version>
+        </dependency>
     </dependencies>
 
     <build>

File res/layout/activity_about.xml

 
     <TextView
         android:id="@+id/about_title"
-        android:text="@string/about_title"
+        android:text="@string/title_about"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:gravity="center_horizontal"
         />
 
     <TextView
-        android:text="@string/about_dialog"
+        android:text="@string/dialog_about"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:gravity="center_horizontal"

File res/layout/activity_main.xml

     <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:text="@string/appedition_name"
+        android:text="@string/name_appedition"
         android:gravity="center_horizontal"
         android:textStyle="bold"
         android:textSize="@dimen/font_large"

File res/values/strings.xml

 
 <resources>
 
-    <string name="app_name">Kargu</string>
-    <string name="edition_name">Listrik</string>
-    <string name="appedition_name">Kargu Listrik</string>
-    <string name="app_version">Versi 0.1</string>
-    <string name="app_tagline">Memperkirakan biaya penggunaan tanpa ragu</string>
+    <string name="name_app">Kargu</string>
+    <string name="name_edition">Listrik</string>
+    <string name="name_appedition">Kargu Listrik</string>
+    <string name="version_app">Versi 0.1</string>
+    <string name="tagline_app">Memperkirakan biaya penggunaan tanpa ragu</string>
 
-    <string name="settings_title">Pengaturan Lengkap</string>
+    <string name="title_number">Angka yang diambil</string>
+
+    <string name="title_settings">Pengaturan Lengkap</string>
     <string name="action_settings">Pengaturan</string>
 
-    <string name="help_title">Bantuan Penggunaan</string>
+    <string name="title_help">Bantuan Penggunaan</string>
     <string name="button_help">Bantuan</string>
     <string name="action_help">Bantuan</string>
-    <string name="help_dialog">Masukkan data mengenai daya listrik dan alat elektronik yang akan Anda gunakan</string>
+    <string name="dialog_help">Masukkan data mengenai daya listrik dan alat elektronik yang akan Anda gunakan</string>
 
-    <string name="about_title">Tentang Aplikasi</string>
+    <string name="title_about">Tentang Aplikasi</string>
     <string name="button_about">Tentang</string>
     <string name="action_about">Tentang</string>
-    <string name="about_dialog">Kargu Listrik, memperkirakan biaya penggunaan listrik tanpa ragu serta membudayakan hemat energi</string>
+    <string name="dialog_about">Kargu Listrik, memperkirakan biaya penggunaan listrik tanpa ragu serta membudayakan hemat energi</string>
 
     <string name="button_close">Tutup</string>
 

File src/com/mhaidarhanif/android/kargu/DisplayNumberActivity.java

 package com.mhaidarhanif.android.kargu;
 
 import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
 import android.os.Build;
 import android.os.Bundle;
+import android.support.v4.app.NavUtils;
 import android.view.MenuItem;
 
 public class DisplayNumberActivity extends MainActivity {
 
   @SuppressLint("NewApi")
 
-  @Override
+  /** Display new activity */
+  @TargetApi(11)
   protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_display_number);
 
-    /** Check min. API level version to use ActionBar API */
-    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUR_DEVELOPMENT) {
+    /** Check minimum API level number to use ActionBar API */
+    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
       // Show Up button in ActionBar
       getActionBar().setDisplayHomeAsUpEnabled(true);
     }
 
   /** Inherit method from ActionBar */
   @Override
-  public boolean onOptionsItemsSelected(MenuItem item) {
+  public boolean onOptionsItemSelected(MenuItem item) {
     switch (item.getItemId()) {
       case android.R.id.home:
         NavUtils.navigateUpFromSameTask(this);

File src/com/mhaidarhanif/android/kargu/MainActivity.java

 public class MainActivity extends Activity {
 
   // For complete title purpose, will be used later
-  // String appEditionName = getString(R.string.app_name) + " " + getString(R.string.edition_name);
+  // String appEditionName = getString(R.string.app_name) + " " + getString(R.string.name_edition);
 
   public final static String EXTRA_NUMBER = "com.mhaidarhanif.android.kargu.NUMBER";