mirror of
				https://github.com/nerzhul/ownCloud-SMS-App.git
				synced 2025-10-31 02:17:53 +00:00 
			
		
		
		
	Map other MainActivity buttons and localize strings
This commit is contained in:
		
							parent
							
								
									acd9d72bb4
								
							
						
					
					
						commit
						7476c8d469
					
				| @ -41,7 +41,7 @@ | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_alignParentLeft="true" | ||||
|         android:layout_alignParentTop="true" | ||||
|         android:text="Add an account" | ||||
|         android:text="@string/ma_title_add_account" | ||||
|         android:textAppearance="?android:attr/textAppearanceLarge" /> | ||||
| 
 | ||||
|     <Button | ||||
| @ -51,7 +51,8 @@ | ||||
|         android:layout_below="@+id/main_tv_accounts" | ||||
|         android:layout_centerHorizontal="true" | ||||
|         android:layout_marginTop="26dp" | ||||
|         android:text="Go to Accounts and Sync" /> | ||||
|         android:onClick="openAddAccount" | ||||
|         android:text="@string/ma_button_goto_sync" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:id="@+id/textView1" | ||||
| @ -60,7 +61,7 @@ | ||||
|         android:layout_above="@+id/main_button_settings" | ||||
|         android:layout_alignLeft="@+id/main_tv_accounts" | ||||
|         android:layout_marginBottom="25dp" | ||||
|         android:text="Change app settings" | ||||
|         android:text="@string/ma_title_change_settings" | ||||
|         android:textAppearance="?android:attr/textAppearanceLarge" /> | ||||
| 
 | ||||
|     <Button | ||||
| @ -70,6 +71,6 @@ | ||||
|         android:layout_centerHorizontal="true" | ||||
|         android:layout_centerVertical="true" | ||||
| 		android:onClick="openAppSettings" | ||||
|         android:text="Go to Settings" /> | ||||
|         android:text="@string/ma_button_goto_settings" /> | ||||
| 
 | ||||
| </RelativeLayout> | ||||
| @ -45,7 +45,7 @@ | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_alignParentLeft="true" | ||||
|         android:layout_alignParentTop="true" | ||||
|         android:text="Welcome" | ||||
|         android:text="@string/ma_title_welcome" | ||||
|         android:textAppearance="?android:attr/textAppearanceLarge" /> | ||||
| 
 | ||||
|     <TextView | ||||
| @ -55,7 +55,7 @@ | ||||
|         android:layout_alignLeft="@+id/section_label" | ||||
|         android:layout_below="@+id/section_label" | ||||
|         android:layout_marginTop="16dp" | ||||
|         android:text="Welcome to ownCloud SMS application. This application let you synchronise your SMS to your ownCloud instance using SMS app." | ||||
|         android:text="@string/ma_content_welcome" | ||||
|         android:textAppearance="?android:attr/textAppearanceMedium" /> | ||||
| 
 | ||||
| </RelativeLayout> | ||||
| @ -43,7 +43,8 @@ | ||||
|         android:layout_centerHorizontal="true" | ||||
|         android:layout_marginTop="22dp" | ||||
|         android:minHeight="36dp" | ||||
|         android:text="Rate us !" | ||||
|         android:text="@string/ma_button_rate_us" | ||||
|         android:onClick="openGooglePlayStore" | ||||
|         android:textAlignment="center" /> | ||||
| 
 | ||||
|     <TextView | ||||
| @ -52,7 +53,7 @@ | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_alignParentLeft="true" | ||||
|         android:layout_alignParentTop="true" | ||||
|         android:text="Thanks to" | ||||
|         android:text="@string/ma_button_thanksto" | ||||
|         android:textAppearance="?android:attr/textAppearanceLarge" /> | ||||
| 
 | ||||
|     <TextView | ||||
| @ -69,19 +70,19 @@ | ||||
|         android:id="@+id/textView1" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_alignLeft="@+id/textView2" | ||||
|         android:layout_alignLeft="@+id/ma_title_rateus" | ||||
|         android:layout_centerVertical="true" | ||||
|         android:text="If you like this application, please give rate us on Google Play Store" | ||||
|         android:text="@string/ma_content_rate_us" | ||||
|         android:textAppearance="?android:attr/textAppearanceMedium" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:id="@+id/textView2" | ||||
|         android:id="@+id/ma_title_rateus" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_above="@+id/textView1" | ||||
|         android:layout_alignLeft="@+id/tv_rateUs" | ||||
|         android:layout_marginBottom="18dp" | ||||
|         android:text="Rate us !" | ||||
|         android:text="@string/ma_title_rate_us" | ||||
|         android:textAppearance="?android:attr/textAppearanceLarge" /> | ||||
| 
 | ||||
| </RelativeLayout> | ||||
| @ -116,6 +116,18 @@ | ||||
|         <item>http://</item> | ||||
|     </string-array> | ||||
|      | ||||
|     <!-- Main activity --> | ||||
|     <string name="ma_button_rate_us">Rate us !</string> | ||||
|     <string name="ma_button_thanksto">Thanks to</string> | ||||
|     <string name="ma_title_rate_us">Rate us !</string> | ||||
|     <string name="ma_content_rate_us">If you like this application, please give rate us on Google Play Store</string> | ||||
|     <string name="ma_title_add_account">Add an account</string> | ||||
|     <string name="ma_button_goto_sync">Go to Accounts and Sync</string> | ||||
|     <string name="ma_title_change_settings">Change app settings</string> | ||||
|     <string name="ma_button_goto_settings">Go to Settings</string> | ||||
|     <string name="ma_title_welcome">Welcome</string> | ||||
|     <string name="ma_content_welcome">Welcome to ownCloud SMS application. This application let you synchronise your SMS to your ownCloud instance using SMS app.</string> | ||||
| 
 | ||||
|     <!-- Notifications --> | ||||
|     <string name="sync_title">Sync process</string> | ||||
|     <string name="sync_inprogress">Sync in progress...</string> | ||||
|  | ||||
| @ -34,7 +34,9 @@ import android.support.v4.app.Fragment; | ||||
| import android.support.v4.app.FragmentManager; | ||||
| import android.support.v4.app.FragmentPagerAdapter; | ||||
| import android.content.Intent; | ||||
| import android.net.Uri; | ||||
| import android.os.Bundle; | ||||
| import android.provider.Settings; | ||||
| import android.support.v4.view.ViewPager; | ||||
| import android.view.LayoutInflater; | ||||
| import android.view.Menu; | ||||
| @ -164,8 +166,22 @@ public class MainActivity extends ActionBarActivity { | ||||
| 	} | ||||
| 	 | ||||
| 	public void openAppSettings(View view) { | ||||
| 		Intent intent = new Intent(this, GeneralSettingsActivity.class); | ||||
| 		startActivity(intent); | ||||
| 		startActivity(new Intent(this, GeneralSettingsActivity.class)); | ||||
| 	} | ||||
| 	 | ||||
| 	public void openAddAccount(View view) { | ||||
| 		startActivity(new Intent(Settings.ACTION_ADD_ACCOUNT)); | ||||
| 	} | ||||
| 
 | ||||
| 	public void openGooglePlayStore(View view) { | ||||
| 		Intent intent; | ||||
| 		try { | ||||
| 			intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getPackageName())); | ||||
| 		     | ||||
| 		} catch (android.content.ActivityNotFoundException anfe) { | ||||
| 		    intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName())); | ||||
| 		} | ||||
| 		 | ||||
| 		startActivity(intent); | ||||
| 	} | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user