fix: user register; update dependencies
This commit is contained in:
12
.idea/misc.xml
generated
12
.idea/misc.xml
generated
@@ -39,17 +39,7 @@
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
<OptionsSetting value="true" id="Remove" />
|
||||
<OptionsSetting value="true" id="Checkout" />
|
||||
<OptionsSetting value="true" id="Update" />
|
||||
<OptionsSetting value="true" id="Status" />
|
||||
<OptionsSetting value="true" id="Edit" />
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.getkeepsafe.dexcount'
|
||||
apply plugin: 'me.tatarka.retrolambda'
|
||||
def AAVersion = '4.2.0'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion "25.0.2"
|
||||
buildToolsVersion '26.0.2'
|
||||
defaultConfig {
|
||||
applicationId "com.stardust.scriptdroid"
|
||||
minSdkVersion 17
|
||||
@@ -40,9 +39,8 @@ android {
|
||||
disable 'ExtraTranslation'
|
||||
}
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def file = output.outputFile
|
||||
output.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk"))
|
||||
variant.outputs.all {
|
||||
outputFileName = "${variant.name}-${variant.versionName}.apk"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +53,7 @@ repositories {
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
google()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -75,10 +74,10 @@ dependencies {
|
||||
})
|
||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
|
||||
// Android supports
|
||||
compile 'com.android.support:appcompat-v7:25.3.1'
|
||||
compile 'com.android.support:cardview-v7:25.3.1'
|
||||
compile 'com.android.support:design:25.3.1'
|
||||
compile 'com.android.support:multidex:1.0.1'
|
||||
compile 'com.android.support:appcompat-v7:25.4.0'
|
||||
compile 'com.android.support:cardview-v7:25.4.0'
|
||||
compile 'com.android.support:design:25.4.0'
|
||||
compile 'com.android.support:multidex:1.0.2'
|
||||
// Personal libraries
|
||||
compile 'com.github.hyb1996:MutableTheme:0.2.2'
|
||||
// Material Dialogs
|
||||
@@ -102,12 +101,12 @@ dependencies {
|
||||
compile 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1'
|
||||
compile 'com.yqritc:recyclerview-flexibledivider:1.4.0'
|
||||
compile 'com.wang.avi:library:2.1.3'
|
||||
compile 'org.apache.commons:commons-lang3:3.5'
|
||||
compile 'org.apache.commons:commons-lang3:3.6'
|
||||
compile 'com.github.hyb1996:FloatingCircularActionMenu:0.0.2'
|
||||
compile(name: 'apkbuilder-release', ext: 'aar')
|
||||
|
||||
// RxJava
|
||||
compile "io.reactivex.rxjava2:rxjava:2.1.0"
|
||||
compile "io.reactivex.rxjava2:rxjava:2.1.2"
|
||||
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
|
||||
// RxDownload
|
||||
compile('zlc.season:rxdownload3:1.0.8', {
|
||||
@@ -120,15 +119,18 @@ dependencies {
|
||||
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
|
||||
//JDeferred
|
||||
compile 'org.jdeferred:jdeferred-android-aar:1.2.6'
|
||||
//Picasso
|
||||
compile 'com.squareup.picasso:picasso:2.5.2'
|
||||
//Glide
|
||||
compile('com.github.bumptech.glide:glide:4.2.0', {
|
||||
exclude group: 'com.android.support'
|
||||
})
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
|
||||
// Tasker Plugin
|
||||
compile 'com.twofortyfouram:android-plugin-client-sdk-for-locale:[4.0.2, 5.0['
|
||||
compile 'com.twofortyfouram:android-plugin-client-sdk-for-locale:4.0.3'
|
||||
compile 'com.flurry.android:analytics:7.0.0@aar'
|
||||
compile('com.afollestad.material-dialogs:commons:0.9.2.3', {
|
||||
exclude group: 'com.android.support'
|
||||
})
|
||||
compile 'com.makeramen:roundedimageview:2.2.1'
|
||||
compile 'com.makeramen:roundedimageview:2.3.0'
|
||||
compile 'com.rengwuxian.materialedittext:library:2.0.3'
|
||||
compile 'org.msgpack:msgpack-core:0.8.11'
|
||||
compile project(':automator')
|
||||
|
||||
@@ -78,7 +78,12 @@
|
||||
<activity android:name=".ui.error.ErrorReportActivity"/>
|
||||
<activity android:name=".external.tasker.TaskerScriptEditActivity_"/>
|
||||
<activity android:name=".ui.edit.ViewSampleActivity"/>
|
||||
<activity android:name=".ui.login.LoginActivity_"/>
|
||||
<activity
|
||||
android:name=".ui.user.LoginActivity_"
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
<activity
|
||||
android:name=".ui.user.RegisterActivity_"
|
||||
android:windowSoftInputMode="adjustResize"/>
|
||||
<activity android:name=".ui.build.BuildActivity_"/>
|
||||
<activity android:name=".ui.doc.DocumentationActivity_"/>
|
||||
<activity android:name=".ui.shortcut.ShortcutIconSelectActivity_"/>
|
||||
|
||||
@@ -44,10 +44,7 @@ public class RunIntentActivity extends Activity {
|
||||
InputStream stream = getContentResolver().openInputStream(uri);
|
||||
Scripts.run(new StringScriptSource(PFiles.read(stream)));
|
||||
} else {
|
||||
final String path = intent.getData().getPath();
|
||||
if (!TextUtils.isEmpty(path)) {
|
||||
Scripts.run(new ScriptFile(path));
|
||||
}
|
||||
CommonUtils.handleIntent(this, intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.stardust.scriptdroid.network;
|
||||
|
||||
import com.bumptech.glide.annotation.GlideModule;
|
||||
import com.bumptech.glide.module.AppGlideModule;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/10/26.
|
||||
*/
|
||||
@GlideModule
|
||||
public class Glides extends AppGlideModule {
|
||||
}
|
||||
@@ -2,8 +2,12 @@ package com.stardust.scriptdroid.network;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||
import com.stardust.scriptdroid.network.api.ConfigApi;
|
||||
import com.stardust.scriptdroid.network.entity.config.Config;
|
||||
import com.stardust.scriptdroid.network.util.WebkitCookieManagerProxy;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Scheduler;
|
||||
import okhttp3.OkHttpClient;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
@@ -14,13 +18,16 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class NodeBB {
|
||||
|
||||
public static final String BASE_URL = "http://www.autojs.org/";
|
||||
private static final NodeBB sInstance = new NodeBB();
|
||||
private Config mConfig;
|
||||
|
||||
|
||||
private Retrofit mRetrofit;
|
||||
|
||||
NodeBB() {
|
||||
mRetrofit = new Retrofit.Builder()
|
||||
.baseUrl("http://www.autojs.org/")
|
||||
.baseUrl(BASE_URL)
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder()
|
||||
.setLenient()
|
||||
.create()))
|
||||
@@ -38,4 +45,14 @@ public class NodeBB {
|
||||
public Retrofit getRetrofit() {
|
||||
return mRetrofit;
|
||||
}
|
||||
|
||||
public Observable<Config> getConfig() {
|
||||
if (mConfig == null) {
|
||||
return mRetrofit.create(ConfigApi.class)
|
||||
.getConfig()
|
||||
.doOnNext(config -> mConfig = config);
|
||||
}
|
||||
return Observable.just(mConfig);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class UserService {
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> login(String userName, final String password) {
|
||||
return mRetrofit.create(ConfigApi.class)
|
||||
return NodeBB.getInstance()
|
||||
.getConfig()
|
||||
.flatMap(config -> {
|
||||
Log.d("login", config.toString());
|
||||
@@ -39,4 +39,15 @@ public class UserService {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> register(String email, String userName, String password) {
|
||||
return NodeBB.getInstance()
|
||||
.getConfig()
|
||||
.flatMap(config -> {
|
||||
Log.d("login", config.toString());
|
||||
return mRetrofit.create(UserApi.class)
|
||||
.register(Collections.singletonMap("x-csrf-token", config.getCsrfToken()),
|
||||
email, userName, password);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,5 +25,10 @@ public interface UserApi {
|
||||
@POST("/login")
|
||||
Observable<ResponseBody> login(@HeaderMap Map<String, String> csrfToken, @Field("username") String userName, @Field("password") String password);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/register")
|
||||
Observable<ResponseBody> register(@HeaderMap Map<String, String> csrfToken, @Field("email") String email,
|
||||
@Field("username") String userName, @Field("password") String password);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class CommunityWebView extends EWebView {
|
||||
private class MyWebChromeClient extends EWebView.MyWebChromeClient {
|
||||
|
||||
@Override
|
||||
public void openFileChooser(ValueCallback<Uri> callback) {
|
||||
public void openFileChooser(ValueCallback<Uri> callback, String[] acceptType, boolean isCaptureEnabled) {
|
||||
new FileChooserDialogBuilder(getContext())
|
||||
.title(R.string.text_select_file_to_upload)
|
||||
.dir(StorageFileProvider.DEFAULT_DIRECTORY_PATH)
|
||||
@@ -128,6 +128,5 @@ public class CommunityWebView extends EWebView {
|
||||
.cancelListener(dialog -> callback.onReceiveValue(null))
|
||||
.show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
package com.stardust.scriptdroid.ui.main.drawer;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.stardust.scriptdroid.App;
|
||||
import com.stardust.scriptdroid.Pref;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.network.GlideApp;
|
||||
import com.stardust.scriptdroid.network.UserService;
|
||||
import com.stardust.scriptdroid.ui.floating.CircularMenu;
|
||||
import com.stardust.scriptdroid.ui.floating.FloatyWindowManger;
|
||||
import com.stardust.scriptdroid.network.NodeBB;
|
||||
@@ -19,10 +26,12 @@ import com.stardust.scriptdroid.network.api.UserApi;
|
||||
import com.stardust.scriptdroid.network.entity.user.User;
|
||||
import com.stardust.scriptdroid.network.entity.VersionInfo;
|
||||
import com.stardust.scriptdroid.tool.SimpleObserver;
|
||||
import com.stardust.scriptdroid.ui.login.LoginActivity_;
|
||||
import com.stardust.scriptdroid.ui.user.LoginActivity_;
|
||||
import com.stardust.scriptdroid.ui.settings.SettingsActivity;
|
||||
import com.stardust.scriptdroid.ui.update.UpdateInfoDialogBuilder;
|
||||
import com.stardust.scriptdroid.ui.widget.AvatarView;
|
||||
import com.stardust.theme.ThemeColorManager;
|
||||
import com.stardust.theme.ThemeColorManagerCompat;
|
||||
import com.stardust.view.accessibility.AccessibilityService;
|
||||
import com.stardust.scriptdroid.sublime.SublimePluginService;
|
||||
import com.stardust.scriptdroid.tool.AccessibilityServiceTool;
|
||||
@@ -69,7 +78,13 @@ public class DrawerFragment extends android.support.v4.app.Fragment {
|
||||
TextView mUserName;
|
||||
|
||||
@ViewById(R.id.avatar)
|
||||
ImageView mAvatar;
|
||||
AvatarView mAvatar;
|
||||
|
||||
@ViewById(R.id.shadow)
|
||||
View mShadow;
|
||||
|
||||
@ViewById(R.id.default_cover)
|
||||
View mDefaultCover;
|
||||
|
||||
|
||||
private Disposable mConnectionStateDisposable;
|
||||
@@ -108,21 +123,36 @@ public class DrawerFragment extends android.support.v4.app.Fragment {
|
||||
.me()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SimpleObserver<User>() {
|
||||
@Override
|
||||
public void onNext(@io.reactivex.annotations.NonNull User user) {
|
||||
setUpUserInfo(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.annotations.NonNull Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
.subscribe(this::setUpUserInfo, Throwable::printStackTrace);
|
||||
}
|
||||
|
||||
private void setUpUserInfo(User user) {
|
||||
mUserName.setText(user.getUsername());
|
||||
mAvatar.setUser(user);
|
||||
setCoverImage(user);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void setCoverImage(User user) {
|
||||
String coverUrl = user.getCoverUrl();
|
||||
if (TextUtils.isEmpty(coverUrl) || coverUrl.equals("/assets/images/cover-default.png")) {
|
||||
mDefaultCover.setVisibility(View.VISIBLE);
|
||||
mShadow.setVisibility(View.GONE);
|
||||
mHeaderView.setBackgroundColor(ThemeColorManagerCompat.getColorPrimary());
|
||||
} else {
|
||||
mDefaultCover.setVisibility(View.GONE);
|
||||
mShadow.setVisibility(View.VISIBLE);
|
||||
GlideApp.with(getContext())
|
||||
.load(NodeBB.BASE_URL + coverUrl)
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.into(new SimpleTarget<Drawable>() {
|
||||
@Override
|
||||
public void onResourceReady(Drawable resource, Transition<? super Drawable> transition) {
|
||||
mHeaderView.setBackground(resource);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Click(R.id.avatar)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.stardust.scriptdroid.ui.login;
|
||||
package com.stardust.scriptdroid.ui.user;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.network.UserService;
|
||||
import com.stardust.scriptdroid.ui.BaseActivity;
|
||||
@@ -39,15 +43,29 @@ public class LoginActivity extends BaseActivity {
|
||||
if (!checkNotEmpty(userName, password)) {
|
||||
return;
|
||||
}
|
||||
MaterialDialog dialog = new MaterialDialog.Builder(this)
|
||||
.progress(true, 0)
|
||||
.content(R.string.text_logining)
|
||||
.cancelable(false)
|
||||
.show();
|
||||
UserService.getInstance().login(userName, password)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(response -> {
|
||||
dialog.dismiss();
|
||||
Toast.makeText(getApplicationContext(), R.string.text_login_succeed, Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
, error ->
|
||||
Toast.makeText(getApplicationContext(), R.string.text_login_fail, Toast.LENGTH_SHORT).show());
|
||||
, error -> {
|
||||
dialog.dismiss();
|
||||
mPassword.setError(getString(R.string.text_login_fail));
|
||||
error.printStackTrace();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Click(R.id.forgot_password)
|
||||
void forgotPassword() {
|
||||
|
||||
}
|
||||
|
||||
@@ -62,4 +80,20 @@ public class LoginActivity extends BaseActivity {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.menu_login, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.action_register) {
|
||||
RegisterActivity_.intent(this).start();
|
||||
finish();
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.stardust.scriptdroid.ui.user;
|
||||
|
||||
import android.util.Log;
|
||||
import android.util.Patterns;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.network.UserService;
|
||||
import com.stardust.scriptdroid.ui.BaseActivity;
|
||||
|
||||
import org.androidannotations.annotations.AfterViews;
|
||||
import org.androidannotations.annotations.Click;
|
||||
import org.androidannotations.annotations.EActivity;
|
||||
import org.androidannotations.annotations.ViewById;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/10/26.
|
||||
*/
|
||||
@EActivity(R.layout.activity_register)
|
||||
public class RegisterActivity extends BaseActivity {
|
||||
|
||||
@ViewById(R.id.email)
|
||||
TextView mEmail;
|
||||
|
||||
@ViewById(R.id.username)
|
||||
TextView mUserName;
|
||||
|
||||
@ViewById(R.id.password)
|
||||
TextView mPassword;
|
||||
|
||||
@AfterViews
|
||||
void setUpViews() {
|
||||
setToolbarAsBack(getString(R.string.text_register));
|
||||
}
|
||||
|
||||
@Click(R.id.register)
|
||||
void login() {
|
||||
String email = mEmail.getText().toString();
|
||||
String userName = mUserName.getText().toString();
|
||||
String password = mPassword.getText().toString();
|
||||
if (!validateInput(email, userName, password)) {
|
||||
return;
|
||||
}
|
||||
MaterialDialog dialog = new MaterialDialog.Builder(this)
|
||||
.progress(true, 0)
|
||||
.content(R.string.text_registering)
|
||||
.cancelable(false)
|
||||
.show();
|
||||
UserService.getInstance().register(email, userName, password)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(response -> {
|
||||
dialog.dismiss();
|
||||
onRegisterResponse(response.string());
|
||||
}
|
||||
, error -> {
|
||||
dialog.dismiss();
|
||||
mPassword.setError(getString(R.string.text_register_fail));
|
||||
error.printStackTrace();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void onRegisterResponse(String res) {
|
||||
Toast.makeText(this, R.string.text_register_succeed, Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
private boolean validateInput(String email, String userName, String password) {
|
||||
if (email.isEmpty()) {
|
||||
mEmail.setError(getString(R.string.text_email_cannot_be_empty));
|
||||
return false;
|
||||
}
|
||||
if (!Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
|
||||
mEmail.setError(getString(R.string.text_email_format_error));
|
||||
return false;
|
||||
}
|
||||
if (userName.isEmpty()) {
|
||||
mUserName.setError(getString(R.string.text_username_cannot_be_empty));
|
||||
return false;
|
||||
}
|
||||
if (password.isEmpty()) {
|
||||
mUserName.setError(getString(R.string.text_password_cannot_be_empty));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.stardust.scriptdroid.ui.user;
|
||||
|
||||
import com.stardust.scriptdroid.ui.BaseActivity;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/10/26.
|
||||
*/
|
||||
|
||||
public class UserDetailActivity extends BaseActivity {
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.stardust.scriptdroid.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.support.annotation.AttrRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.nickandjerry.dynamiclayoutinflator.lib.DynamicLayoutInflator;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.network.GlideApp;
|
||||
import com.stardust.scriptdroid.network.Glides;
|
||||
import com.stardust.scriptdroid.network.NodeBB;
|
||||
import com.stardust.scriptdroid.network.entity.user.User;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
/**
|
||||
* Created by 婷 on 2017/9/29.
|
||||
*/
|
||||
|
||||
public class AvatarView extends FrameLayout {
|
||||
|
||||
@BindView(R.id.icon_text)
|
||||
TextView mIconText;
|
||||
|
||||
@BindView(R.id.icon)
|
||||
RoundedImageView mIcon;
|
||||
|
||||
private GradientDrawable mIconTextBackground;
|
||||
|
||||
|
||||
public AvatarView(@NonNull Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public AvatarView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public AvatarView(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
inflate(getContext(), R.layout.avatar_view, this);
|
||||
ButterKnife.bind(this);
|
||||
mIconTextBackground = (GradientDrawable) mIconText.getBackground();
|
||||
}
|
||||
|
||||
public void setUser(final User user) {
|
||||
if (TextUtils.isEmpty(user.getPicture())) {
|
||||
mIcon.setVisibility(View.GONE);
|
||||
mIconText.setVisibility(View.VISIBLE);
|
||||
mIconTextBackground.setColor(Color.parseColor(user.getIconBgColor()));
|
||||
mIconTextBackground.setCornerRadius(getWidth() / 2);
|
||||
mIconText.setText(user.getIconText());
|
||||
} else {
|
||||
mIcon.setVisibility(View.VISIBLE);
|
||||
mIconText.setVisibility(View.GONE);
|
||||
mIcon.setCornerRadius(getWidth() / 2);
|
||||
GlideApp.with(getContext())
|
||||
.load(NodeBB.BASE_URL + user.getPicture())
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.skipMemoryCache(true)
|
||||
.into(mIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,25 +82,19 @@ public class EWebView extends FrameLayout implements SwipeRefreshLayout.OnRefres
|
||||
mProgressBar.setProgress(newProgress);
|
||||
}
|
||||
|
||||
|
||||
// For Android < 3.0
|
||||
public void openFileChooser(ValueCallback<Uri> valueCallback) {
|
||||
|
||||
}
|
||||
|
||||
// For Android >= 3.0
|
||||
@SuppressWarnings("unchecked")
|
||||
public void openFileChooser(ValueCallback valueCallback, String acceptType) {
|
||||
openFileChooser(valueCallback);
|
||||
}
|
||||
|
||||
//For Android >= 4.1
|
||||
public void openFileChooser(ValueCallback<Uri> valueCallback,
|
||||
String acceptType, String capture) {
|
||||
openFileChooser(valueCallback);
|
||||
openFileChooser(valueCallback, acceptType.split(","), capture.equals("true"));
|
||||
}
|
||||
|
||||
public void openFileChooser(ValueCallback<Uri> valueCallback,
|
||||
String[] acceptType, boolean isCaptureEnabled) {
|
||||
|
||||
}
|
||||
|
||||
// For Android >= 5.0
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView,
|
||||
ValueCallback<Uri[]> filePathCallback,
|
||||
@@ -111,7 +105,7 @@ public class EWebView extends FrameLayout implements SwipeRefreshLayout.OnRefres
|
||||
} else {
|
||||
filePathCallback.onReceiveValue(new Uri[]{value});
|
||||
}
|
||||
});
|
||||
}, fileChooserParams.getAcceptTypes(), fileChooserParams.isCaptureEnabled());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
9
app/src/main/res/drawable/avatar_view_bg.xml
Normal file
9
app/src/main/res/drawable/avatar_view_bg.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<corners android:radius="25dp"/>
|
||||
<size
|
||||
android:width="50dp"
|
||||
android:height="50dp"/>
|
||||
<solid android:color="#d56"/>
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/drawer_header_shadow.xml
Normal file
10
app/src/main/res/drawable/drawer_header_shadow.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle"
|
||||
>
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#7d000000"
|
||||
android:startColor="#27ffffff"/>
|
||||
</shape>
|
||||
BIN
app/src/main/res/drawable/ic_ali_register.png
Normal file
BIN
app/src/main/res/drawable/ic_ali_register.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
@@ -1,158 +1,102 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:orientation="vertical">
|
||||
<FrameLayout 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">
|
||||
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorToolbar
|
||||
android:id="@+id/toolbar"
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:title="@string/text_login"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/cv"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="64dp"
|
||||
app:cardCornerRadius="6dp"
|
||||
app:cardElevation="3dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<View
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentStart="true"
|
||||
android:background="#2fa881"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="50dp"
|
||||
android:text="@string/text_login"
|
||||
android:textColor="#FFCC00"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="30dp"
|
||||
android:paddingStart="50dp">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_username"
|
||||
android:inputType="textPersonName"
|
||||
android:textSize="16sp"/>
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="30dp"
|
||||
android:paddingStart="50dp">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_password"
|
||||
android:inputType="textPassword"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:gravity="center">
|
||||
|
||||
<Button
|
||||
android:id="@+id/login"
|
||||
style="@style/Widget.AppCompat.Button.Colored"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="50dp"
|
||||
android:text="@string/text_login"
|
||||
>
|
||||
</Button>
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/text_forgot_password"
|
||||
android:textColor="#9a9a9a"
|
||||
android:textSize="12sp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignEnd="@id/cv"
|
||||
android:layout_alignTop="@id/cv"
|
||||
android:layout_marginEnd="-20dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:src="@drawable/ic_add_white_48dp"
|
||||
android:transitionName="loginFab"
|
||||
app:fabSize="normal"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:title="@string/text_login"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_username"
|
||||
android:textColor="#dd000000"/>
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_password"
|
||||
android:inputType="textPassword"
|
||||
android:textColor="#dd000000"/>
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/forgot_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="4dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_forgot_password"
|
||||
android:textColor="#929397"
|
||||
android:textSize="12sp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_reset_password"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="12sp"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/colorPrimary"
|
||||
android:foreground="?selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:padding="12dp"
|
||||
android:text="@string/text_login"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="15sp"/>
|
||||
|
||||
</FrameLayout>
|
||||
95
app/src/main/res/layout/activity_register.xml
Normal file
95
app/src/main/res/layout/activity_register.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:title="@string/text_login"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_email"
|
||||
android:inputType="textEmailAddress"
|
||||
android:textColor="#dd000000"/>
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_username"
|
||||
android:textColor="#dd000000"/>
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_password"
|
||||
android:inputType="textPassword"
|
||||
android:textColor="#dd000000"/>
|
||||
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/register"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/colorPrimary"
|
||||
android:foreground="?selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:padding="12dp"
|
||||
android:text="@string/text_register"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="15sp"/>
|
||||
|
||||
</FrameLayout>
|
||||
28
app/src/main/res/layout/avatar_view.xml
Normal file
28
app/src/main/res/layout/avatar_view.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/icon_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/avatar_view_bg"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"
|
||||
tools:text="A"/>
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/profile_avatar_placeholder"
|
||||
app:riv_mutate_background="true"
|
||||
app:riv_oval="true"/>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -16,18 +16,21 @@
|
||||
android:layout_height="170dp"
|
||||
android:layout_marginBottom="5dp">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
<View
|
||||
android:id="@+id/shadow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/drawer_header_shadow"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<com.stardust.scriptdroid.ui.widget.AvatarView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_above="@+id/username"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/profile_avatar_placeholder"
|
||||
app:riv_border_color="#77f2f3f5"
|
||||
app:riv_border_width="0.5dp"
|
||||
app:riv_corner_radius="40dp"/>
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
@@ -35,24 +38,23 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/not_login"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp"/>
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/default_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="118dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="-12dp"
|
||||
android:layout_toRightOf="@+id/avatar"
|
||||
android:alpha="0.08"
|
||||
android:src="@drawable/android_eating_half"
|
||||
android:tint="#000000"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
10
app/src/main/res/menu/menu_login.xml
Normal file
10
app/src/main/res/menu/menu_login.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_register"
|
||||
android:icon="@drawable/ic_ali_register"
|
||||
android:title="@string/text_register"
|
||||
app:showAsAction="always"/>
|
||||
</menu>
|
||||
@@ -200,7 +200,7 @@
|
||||
<string name="text_username">用户名</string>
|
||||
<string name="text_password">密码</string>
|
||||
<string name="text_login">登录</string>
|
||||
<string name="text_forgot_password">忘记密码</string>
|
||||
<string name="text_forgot_password">忘记密码?</string>
|
||||
<string name="text_username_cannot_be_empty">用户名不能为空</string>
|
||||
<string name="text_password_cannot_be_empty">密码不能为空</string>
|
||||
<string name="text_time">时间</string>
|
||||
@@ -266,6 +266,15 @@
|
||||
<string name="text_use_android_n_shortcut">添加到图标快捷方式</string>
|
||||
<string name="text_login_succeed">登录成功</string>
|
||||
<string name="text_login_fail">登录失败</string>
|
||||
<string name="text_reset_password">重置密码</string>
|
||||
<string name="text_logining">登录中</string>
|
||||
<string name="text_register">注册</string>
|
||||
<string name="text_email">邮箱</string>
|
||||
<string name="text_email_cannot_be_empty">邮箱不能为空</string>
|
||||
<string name="text_email_format_error">邮箱格式错误</string>
|
||||
<string name="text_registering">注册中</string>
|
||||
<string name="text_register_fail">注册失败</string>
|
||||
<string name="text_register_succeed">注册成功</string>
|
||||
|
||||
|
||||
<string-array name="ad_showing_mode_keys">
|
||||
|
||||
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion "25.0.2"
|
||||
buildToolsVersion '26.0.2'
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 17
|
||||
|
||||
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion "25.0.2"
|
||||
buildToolsVersion '26.0.2'
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 17
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||
classpath 'com.android.tools.build:gradle:3.0.0'
|
||||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.4'
|
||||
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion "25.0.2"
|
||||
buildToolsVersion '26.0.2'
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 17
|
||||
|
||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
#Sat Mar 04 22:18:28 CST 2017
|
||||
#Thu Oct 26 16:01:06 CST 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
|
||||
|
||||
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion "25.0.2"
|
||||
buildToolsVersion '26.0.2'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.stardust.auojs.inrt"
|
||||
|
||||
Reference in New Issue
Block a user