添加国际化支持

0515
panqihua 5 years ago
parent 79275aa1c8
commit 3a79ba8aeb
  1. 5
      app/build.gradle
  2. 13
      app/src/main/AndroidManifest.xml
  3. 93
      app/src/main/java/com/community/pocket/TitleBarView.java
  4. 8
      app/src/main/java/com/community/pocket/data/adapter/LocaleAdapter.java
  5. 8
      app/src/main/java/com/community/pocket/ui/MainActivity.java
  6. 97
      app/src/main/java/com/community/pocket/ui/login/LoginActivity.java
  7. 11
      app/src/main/java/com/community/pocket/ui/register/RegisterActivity.java
  8. 84
      app/src/main/res/layout/activity_login.xml
  9. 24
      app/src/main/res/layout/activity_register.xml
  10. 10
      app/src/main/res/layout/titlebar_view.xml
  11. 4
      app/src/main/res/values-en-rUS/dimens.xml
  12. 9
      app/src/main/res/values-en-rUS/strings.xml
  13. 4
      app/src/main/res/values-zh-rCN/dimens.xml
  14. 9
      app/src/main/res/values-zh-rCN/strings.xml
  15. 4
      app/src/main/res/values/attrs.xml
  16. 2
      app/src/main/res/values/dimens.xml
  17. 13
      app/src/main/res/values/strings.xml
  18. 11
      app/src/main/res/values/styles.xml

@ -6,7 +6,7 @@ android {
defaultConfig { defaultConfig {
applicationId "com.community.pocket" applicationId "com.community.pocket"
minSdkVersion 15 minSdkVersion 17
targetSdkVersion 29 targetSdkVersion 29
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
@ -31,6 +31,8 @@ dependencies {
implementation 'androidx.annotation:annotation:1.1.0' implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment:2.2.1'
implementation 'androidx.navigation:navigation-ui:2.2.1'
testImplementation 'junit:junit:4.13' testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
@ -38,4 +40,5 @@ dependencies {
implementation 'com.github.jokar:multi-languages:0.0.8' implementation 'com.github.jokar:multi-languages:0.0.8'
implementation 'org.xutils:xutils:3.8.5' implementation 'org.xutils:xutils:3.8.5'
implementation 'com.squareup.okhttp3:okhttp:4.4.1' implementation 'com.squareup.okhttp3:okhttp:4.4.1'
implementation 'com.wuhenzhizao:titlebar:1.2.0'
} }

@ -3,17 +3,16 @@
package="com.community.pocket"> package="com.community.pocket">
<application <application
android:name=".util.InitApp"
android:allowBackup="true" android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme.NoActionBar">
android:name=".util.InitApp"
android:fullBackupContent="@xml/backup_descriptor"> <activity android:name=".ui.register.RegisterActivity" />
<activity <activity android:name=".ui.login.LoginActivity">
android:name=".ui.login.LoginActivity"
android:label="@string/app_name">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

@ -0,0 +1,93 @@
package com.community.pocket;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import androidx.appcompat.widget.AppCompatSpinner;
import com.community.pocket.data.adapter.LocaleAdapter;
import com.community.pocket.ui.login.LoginActivity;
import com.community.pocket.util.LocalManageUtil;
import com.community.pocket.util.LocaleType;
import com.community.pocket.util.SPUtil;
/**
* 自定义顶部标题栏
*/
public class TitleBarView extends AppCompatSpinner {
public TitleBarView(Context context) {
super(context);
init(null, 0);
}
public TitleBarView(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs, 0);
}
public TitleBarView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(attrs, defStyle);
}
private void init(AttributeSet attrs, int defStyle) {
// Load attributes
final TypedArray a = getContext().obtainStyledAttributes(
attrs, R.styleable.TitleBarView, defStyle, 0);
initSpanner();
a.recycle();
}
private void initSpanner() {
//加载语言选项
this.setAdapter(new LocaleAdapter(LayoutInflater.from(getContext())));
this.setSelection(SPUtil.getInstance(getContext()).getSelectLanguage());
// //选择语言事件
this.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (SPUtil.getInstance(getContext()).getSelectLanguage() != position) {
LocaleType locale = LocaleType.getLocale(position);
selectLanguage(locale);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
/**
* 选择语言
*
* @param locale 语言
*/
private void selectLanguage(LocaleType locale) {
LocalManageUtil.saveSelectLanguage(getContext(), locale.getType());
reStart(getContext());
}
/**
* 重启
*
* @param context 应用上下文
*/
public static void reStart(Context context) {
Intent intent = new Intent(context, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
}

@ -1,11 +1,14 @@
package com.community.pocket.data.adapter; package com.community.pocket.data.adapter;
import android.os.Build;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.RequiresApi;
import com.community.pocket.util.LocaleType; import com.community.pocket.util.LocaleType;
import org.xutils.view.annotation.ViewInject; import org.xutils.view.annotation.ViewInject;
@ -33,6 +36,7 @@ public class LocaleAdapter extends BaseAdapter {
return position; return position;
} }
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder; ViewHolder viewHolder;
@ -45,7 +49,9 @@ public class LocaleAdapter extends BaseAdapter {
} else { } else {
viewHolder = (ViewHolder) convertView.getTag(); viewHolder = (ViewHolder) convertView.getTag();
} }
viewHolder.childName.setText(convertView.getResources().getText(LocaleType.getLocale(position).getResId())); String text = convertView.getResources().getString(LocaleType.getLocale(position).getResId());
viewHolder.childName.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
viewHolder.childName.setText(text);
return convertView; return convertView;
} }

@ -1,8 +0,0 @@
package com.community.pocket.ui;
import android.annotation.SuppressLint;
@SuppressLint("Registered")
public class MainActivity extends BaseActivity {
}

@ -1,20 +1,15 @@
package com.community.pocket.ui.login; package com.community.pocket.ui.login;
import android.app.Activity; import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -24,14 +19,11 @@ import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.community.pocket.R; import com.community.pocket.R;
import com.community.pocket.data.adapter.LocaleAdapter;
import com.community.pocket.ui.BaseActivity; import com.community.pocket.ui.BaseActivity;
import com.community.pocket.util.LocalManageUtil;
import com.community.pocket.util.LocaleType;
import com.community.pocket.util.PropertiesUtil; import com.community.pocket.util.PropertiesUtil;
import com.community.pocket.util.SPUtil;
import org.xutils.view.annotation.ContentView; import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject; import org.xutils.view.annotation.ViewInject;
/** /**
@ -43,10 +35,6 @@ public class LoginActivity extends BaseActivity {
private LoginViewModel loginViewModel; private LoginViewModel loginViewModel;
//选择语言
@ViewInject(R.id.selectLang)
private Spinner spinner;
//用户名 //用户名
@ViewInject(R.id.username) @ViewInject(R.id.username)
private EditText usernameEditText; private EditText usernameEditText;
@ -66,7 +54,6 @@ public class LoginActivity extends BaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_login);
loginViewModel = new ViewModelProvider(this, new LoginViewModelFactory()).get(LoginViewModel.class); loginViewModel = new ViewModelProvider(this, new LoginViewModelFactory()).get(LoginViewModel.class);
@ -109,25 +96,6 @@ public class LoginActivity extends BaseActivity {
}); });
//加载语言选项
spinner.setAdapter(new LocaleAdapter(LayoutInflater.from(this)));
spinner.setSelection(SPUtil.getInstance(getBaseContext()).getSelectLanguage());
//选择语言事件
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (SPUtil.getInstance(getBaseContext()).getSelectLanguage() != position) {
LocaleType locale = LocaleType.getLocale(position);
selectLanguage(locale);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
// 监听用户密码文本输入框内容改变 // 监听用户密码文本输入框内容改变
TextWatcher afterTextChangedListener = new TextWatcher() { TextWatcher afterTextChangedListener = new TextWatcher() {
@Override @Override
@ -150,32 +118,27 @@ public class LoginActivity extends BaseActivity {
//添加监听器到组件 //添加监听器到组件
usernameEditText.addTextChangedListener(afterTextChangedListener); usernameEditText.addTextChangedListener(afterTextChangedListener);
passwordEditText.addTextChangedListener(afterTextChangedListener); passwordEditText.addTextChangedListener(afterTextChangedListener);
}
//监听密码软键盘输入 //登录按钮触发登录请求操作
passwordEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Event(value = R.id.login)
private void login(View v) {
@Override //显示登录请求处理进度
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { loadingProgressBar.setVisibility(View.VISIBLE);
//点击完成执行登陆操作 loginViewModel.login(usernameEditText.getText().toString(),
if (actionId == EditorInfo.IME_ACTION_DONE) { passwordEditText.getText().toString());
loginViewModel.login(usernameEditText.getText().toString(), }
passwordEditText.getText().toString());
}
//默认不执行任何操作
return false;
}
});
//登录按钮触发登录请求操作 //监听密码软键盘输入
loginButton.setOnClickListener(new View.OnClickListener() { @Event(type = TextView.OnEditorActionListener.class, value = R.id.password)
@Override private boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
public void onClick(View v) { //点击完成执行登陆操作
//显示登录请求处理进度 if (actionId == EditorInfo.IME_ACTION_DONE) {
loadingProgressBar.setVisibility(View.VISIBLE); loginViewModel.login(usernameEditText.getText().toString(),
loginViewModel.login(usernameEditText.getText().toString(), passwordEditText.getText().toString());
passwordEditText.getText().toString()); }
} //默认不执行任何操作
}); return false;
} }
//登陆成功信息 //登陆成功信息
@ -190,24 +153,4 @@ public class LoginActivity extends BaseActivity {
Toast.makeText(getApplicationContext(), errorString, Toast.LENGTH_SHORT).show(); Toast.makeText(getApplicationContext(), errorString, Toast.LENGTH_SHORT).show();
} }
/**
* 选择语言
*
* @param locale 语言
*/
private void selectLanguage(LocaleType locale) {
LocalManageUtil.saveSelectLanguage(this, locale.getType());
reStart(this);
}
/**
* 重启
*
* @param context 应用上下文
*/
public static void reStart(Context context) {
Intent intent = new Intent(context, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
} }

@ -0,0 +1,11 @@
package com.community.pocket.ui.register;
import com.community.pocket.R;
import org.xutils.view.annotation.ContentView;
@ContentView(R.layout.activity_register)
public class RegisterActivity {
}

@ -11,6 +11,20 @@
android:paddingBottom="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".ui.login.LoginActivity"> tools:context=".ui.login.LoginActivity">
<com.wuhenzhizao.titlebar.widget.CommonTitleBar
android:id="@+id/titlebar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:leftText="@string/app_name"
app:leftType="textView"
app:rightCustomView="@layout/titlebar_view"
app:rightType="customView"
app:titleBarColor="#2CE1CF"
tools:leftText="@string/app_name" />
<EditText <EditText
android:id="@+id/username" android:id="@+id/username"
android:layout_width="0dp" android:layout_width="0dp"
@ -19,13 +33,13 @@
android:layout_marginTop="96dp" android:layout_marginTop="96dp"
android:layout_marginEnd="24dp" android:layout_marginEnd="24dp"
android:hint="@string/prompt_email" android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:inputType="textEmailAddress" android:hint="@string/prompt_user"
android:inputType="text"
android:selectAllOnFocus="true" android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
android:autofillHints="@string/AUTOFILL_HINT_USERNAME" />
<EditText <EditText
android:id="@+id/password" android:id="@+id/password"
@ -35,6 +49,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="24dp" android:layout_marginEnd="24dp"
android:autofillHints="@string/AUTOFILL_HINT_PASSWORD"
android:hint="@string/prompt_password" android:hint="@string/prompt_password"
android:imeActionLabel="@string/action_sign_in_short" android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionDone" android:imeOptions="actionDone"
@ -42,25 +57,7 @@
android:selectAllOnFocus="true" android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/username" app:layout_constraintTop_toBottomOf="@+id/username" />
android:autofillHints="@string/AUTOFILL_HINT_PASSWORD" />
<Button
android:id="@+id/login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginStart="48dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="48dp"
android:layout_marginBottom="64dp"
android:enabled="false"
android:text="@string/action_sign_in"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/password"
app:layout_constraintVertical_bias="0.2" />
<ProgressBar <ProgressBar
android:id="@+id/loading" android:id="@+id/loading"
@ -78,23 +75,32 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.3" /> app:layout_constraintVertical_bias="0.3" />
<Spinner <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/selectLang"
android:layout_width="250dp" android:layout_width="250dp"
android:layout_height="wrap_content" android:layout_height="49dp"
android:gravity="center" android:layout_marginTop="50dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/password">
<TextView <Button
android:id="@+id/textView" android:id="@+id/login"
android:layout_width="115dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="4dp" android:enabled="false"
android:layout_marginRight="4dp" android:text="@string/action_sign_in"
android:gravity="center" app:layout_constraintBottom_toBottomOf="parent"
android:text="@string/language_choose" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/selectLang" app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintEnd_toStartOf="@+id/selectLang"
app:layout_constraintTop_toTopOf="@+id/selectLang" /> <Button
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="true"
android:text="@string/action_register"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.register.RegisterActivity">
<EditText
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="96dp"
android:layout_marginEnd="24dp"
android:autofillHints="@string/AUTOFILL_HINT_USERNAME"
android:hint="@string/prompt_user"
android:inputType="text"
android:selectAllOnFocus="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,10 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.community.pocket.TitleBarView
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.community.pocket.TitleBarView>
</FrameLayout>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="size_8">8dp</dimen>
</resources>

@ -1,9 +1,9 @@
<resources> <resources>
<string name="app_name">PocketCommunityClient</string> <string name="app_name">PocketCommunityClient</string>
<!-- Strings related to login --> <!-- Strings related to login -->
<string name="prompt_email">Email</string> <string name="prompt_user">please input username</string>
<string name="prompt_password">Password</string> <string name="prompt_password">please input password</string>
<string name="action_sign_in">Sign in or register</string> <string name="action_sign_in">Sign in</string>
<string name="action_sign_in_short">Sign in</string> <string name="action_sign_in_short">Sign in</string>
<string name="welcome">"Welcome !"</string> <string name="welcome">"Welcome !"</string>
<string name="invalid_username">Not a valid username</string> <string name="invalid_username">Not a valid username</string>
@ -15,4 +15,7 @@
<string name="language_choose">current language</string> <string name="language_choose">current language</string>
<string name="AUTOFILL_HINT_PASSWORD">password</string> <string name="AUTOFILL_HINT_PASSWORD">password</string>
<string name="AUTOFILL_HINT_USERNAME">username</string> <string name="AUTOFILL_HINT_USERNAME">username</string>
<string name="action_register">Register</string>
<string name="action_back">back</string>
<string name="action_config">system config</string>
</resources> </resources>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="size_8">8dp</dimen>
</resources>

@ -1,9 +1,9 @@
<resources> <resources>
<string name="app_name">口袋社区</string> <string name="app_name">口袋社区</string>
<!-- Strings related to login --> <!-- Strings related to login -->
<string name="prompt_email">邮箱</string> <string name="prompt_user">请输入用户名</string>
<string name="prompt_password">密码</string> <string name="prompt_password">请输入密码</string>
<string name="action_sign_in">登陆或注册</string> <string name="action_sign_in">登陆</string>
<string name="action_sign_in_short">登陆</string> <string name="action_sign_in_short">登陆</string>
<string name="welcome">"欢迎 !"</string> <string name="welcome">"欢迎 !"</string>
<string name="invalid_username">用户名不合法</string> <string name="invalid_username">用户名不合法</string>
@ -15,4 +15,7 @@
<string name="language_choose">当前界面语言</string> <string name="language_choose">当前界面语言</string>
<string name="AUTOFILL_HINT_PASSWORD">password</string> <string name="AUTOFILL_HINT_PASSWORD">password</string>
<string name="AUTOFILL_HINT_USERNAME">username</string> <string name="AUTOFILL_HINT_USERNAME">username</string>
<string name="action_register">注册</string>
<string name="action_back">返回</string>
<string name="action_config">配置</string>
</resources> </resources>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="TitleBarView" />
</resources>

@ -2,4 +2,6 @@
<!-- Default screen margins, per the Android Design guidelines. --> <!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="size_8">8dp</dimen>
</resources> </resources>

@ -1,9 +1,9 @@
<resources> <resources>
<string name="app_name">PocketCommunityClient</string> <string name="app_name">PocketCommunityClient</string>
<!-- Strings related to login --> <!-- Strings related to login -->
<string name="prompt_email">Email</string> <string name="prompt_user">please input username</string>
<string name="prompt_password">Password</string> <string name="prompt_password">please input password</string>
<string name="action_sign_in">Sign in or register</string> <string name="action_sign_in">Sign in</string>
<string name="action_sign_in_short">Sign in</string> <string name="action_sign_in_short">Sign in</string>
<string name="welcome">"Welcome !"</string> <string name="welcome">"Welcome !"</string>
<string name="invalid_username">Not a valid username</string> <string name="invalid_username">Not a valid username</string>
@ -15,4 +15,11 @@
<string name="language_choose">current language</string> <string name="language_choose">current language</string>
<string name="AUTOFILL_HINT_PASSWORD">password</string> <string name="AUTOFILL_HINT_PASSWORD">password</string>
<string name="AUTOFILL_HINT_USERNAME">username</string> <string name="AUTOFILL_HINT_USERNAME">username</string>
<string name="action_register">Register</string>
<string name="action_back">back</string>
<string name="action_config">system config</string>
<!-- Strings used for fragments for navigation -->
<!-- Strings used for fragments for navigation -->
</resources> </resources>

@ -3,9 +3,18 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorAccent</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
</style> </style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources> </resources>

Loading…
Cancel
Save