Commit 9be118fa by chengfengpiaopiao

增加webview

parent de10ecd9
Showing with 495 additions and 101 deletions
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager"> <component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" /> <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
...@@ -52,7 +55,7 @@ ...@@ -52,7 +55,7 @@
</profile-state> </profile-state>
</entry> </entry>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
......
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/DuoBaoJingCai.iml" filepath="$PROJECT_DIR$/DuoBaoJingCai.iml" /> <module fileurl="file://$PROJECT_DIR$/DuoBaoJingCai.iml" filepath="$PROJECT_DIR$/DuoBaoJingCai.iml" />
<module fileurl="file://G:\Product\Android\DuoBaoJingCai\DuoBaoJingCai2.iml" filepath="G:\Product\Android\DuoBaoJingCai\DuoBaoJingCai2.iml" /> <module fileurl="file://$PROJECT_DIR$/DuoBaoJingCai2.iml" filepath="$PROJECT_DIR$/DuoBaoJingCai2.iml" />
<module fileurl="file://G:/Product/Android/DuoBaoJingCai/DuoBaoJingCai2.iml" filepath="G:/Product/Android/DuoBaoJingCai/DuoBaoJingCai2.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://G:\Product\Android\DuoBaoJingCai\app\app.iml" filepath="G:\Product\Android\DuoBaoJingCai\app\app.iml" /> <module fileurl="file://G:/Product/Android/DuoBaoJingCai/app/app.iml" filepath="G:/Product/Android/DuoBaoJingCai/app/app.iml" />
</modules> </modules>
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -27,6 +27,7 @@ android { ...@@ -27,6 +27,7 @@ android {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
} }
debug { debug {
...@@ -44,16 +45,16 @@ dependencies { ...@@ -44,16 +45,16 @@ dependencies {
compile 'com.android.support:appcompat-v7:25.0.0' compile 'com.android.support:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile "com.jakewharton:butterknife:$rootProject.ButterKnife" compile "com.jakewharton:butterknife:6.1.0"
compile "com.squareup.retrofit2:retrofit:$Retrofit" compile "com.squareup.retrofit2:retrofit:2.0.2"
compile "com.squareup.retrofit2:converter-gson:$Retrofit" compile "com.squareup.retrofit2:converter-gson:2.0.2"
compile "com.squareup.retrofit2:adapter-rxjava:$Retrofit" compile "com.squareup.retrofit2:adapter-rxjava:2.0.2"
compile 'io.reactivex:rxandroid:1.2.1' compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.9' compile 'io.reactivex:rxjava:1.1.9'
compile 'com.google.code.gson:gson:2.6.2' compile 'com.google.code.gson:gson:2.6.2'
compile "com.squareup.okhttp3:logging-interceptor:$loggingInterceptor" compile "com.squareup.okhttp3:logging-interceptor:3.2.0"
compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:1.0.2' compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:1.0.2'
compile 'cz.msebera.android:httpclient:4.4.1.1' compile 'cz.msebera.android:httpclient:4.4.1.1'
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<activity <activity
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:name=".view.activity.LoginActivity"> android:name=".view.activity.LoginActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
android:name=".view.activity.MainActivity" android:name=".view.activity.MainActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTask" android:launchMode="singleTask"
android:theme="@android:style/Theme.Translucent"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
......
package com.maile.jingcai.base;
import android.support.v4.app.Fragment;
/**
* Created by chengfeng-piaopiao on 2017/11/10.
*/
public class BaseFragment extends Fragment {
public static boolean isLoading = false;
}
...@@ -25,4 +25,9 @@ public interface LoginApiService { ...@@ -25,4 +25,9 @@ public interface LoginApiService {
@Query("openid") String openid, @Query("openid") String openid,
@Query("accountType") String accountType , @Query("accountType") String accountType ,
@Query("avatar") String avatar , @Query("nickname") String nickname); @Query("avatar") String avatar , @Query("nickname") String nickname);
@GET("autoLogin")
Observable<WrapperRspEntity<String>> autoLogin (@Query("token") String token);
@GET("h5AutoLogin")
Observable<WrapperRspEntity<String>> h5AutoLogin(@Query("token") String token);
} }
package com.maile.jingcai.module.net.interceptor; package com.maile.jingcai.module.net.interceptor;
import android.util.Log;
import com.maile.jingcai.base.Constant;
import com.maile.jingcai.util.InterceptorUtils; import com.maile.jingcai.util.InterceptorUtils;
import org.json.JSONException; import org.json.JSONException;
...@@ -16,16 +19,20 @@ import okhttp3.ResponseBody; ...@@ -16,16 +19,20 @@ import okhttp3.ResponseBody;
* @date 2016/8/31 * @date 2016/8/31
*/ */
public class RspCheckInterceptor implements Interceptor { public class RspCheckInterceptor implements Interceptor {
@Override @Override
public Response intercept(Chain chain) throws IOException { public Response intercept(Chain chain) throws IOException {
Response response = chain.proceed(chain.request()); Response response = chain.proceed(chain.request());
try { try {
ResponseBody rspBody = response.body(); ResponseBody rspBody = response.body();
JSONObject jsonObject = new JSONObject(InterceptorUtils.getRspData(rspBody)); JSONObject jsonObject = new JSONObject(InterceptorUtils.getRspData(rspBody));
Log.d("tangwen", Constant.BASE_URL + "[/]: " + jsonObject.toString());
int status = jsonObject.getInt("code");//status int status = jsonObject.getInt("code");//status
if (status != 0 && status != 200){ if (status != 0 && status != 200){ //请求失败
throw new IOException(jsonObject.getString("msg")); String msg = jsonObject.getString("msg");
if(status == 500 || status == 404){
msg = "服务器异常";
}
throw new IOException(msg);
} }
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -39,4 +46,18 @@ public class RspCheckInterceptor implements Interceptor { ...@@ -39,4 +46,18 @@ public class RspCheckInterceptor implements Interceptor {
return response; return response;
} }
public void codeResponse(int code){
switch (code){
case 1005: // 自动登录验证错误
break;
case 1002:
break;
case 998: // 自动登录已过期
break;
case 1023: // 错误的uid
break;
}
}
} }
...@@ -10,5 +10,6 @@ public class IPreferencesIds { ...@@ -10,5 +10,6 @@ public class IPreferencesIds {
public static final String DEFAULT_SHAREPREFERENCES_FILE = "default_cfg"; public static final String DEFAULT_SHAREPREFERENCES_FILE = "default_cfg";
// KEY // KEY
public static final String IS_LOGIN = "is_login"; public static final String TOKEN = "TOKEN";
public static final String openid_phone = "openid_phone";
} }
...@@ -119,8 +119,9 @@ public final class PreferencesManager { ...@@ -119,8 +119,9 @@ public final class PreferencesManager {
public String getString(String key, String defValue) { public String getString(String key, String defValue) {
if (mPreferences != null) { if (mPreferences != null) {
return mPreferences.getString(key, defValue); return mPreferences.getString(key, defValue);
}else{
return defValue;
} }
return defValue;
} }
@TargetApi(Build.VERSION_CODES.HONEYCOMB) @TargetApi(Build.VERSION_CODES.HONEYCOMB)
...@@ -168,6 +169,7 @@ public final class PreferencesManager { ...@@ -168,6 +169,7 @@ public final class PreferencesManager {
public void putString(String key, String s) { public void putString(String key, String s) {
if (mEditor != null) { if (mEditor != null) {
mEditor.putString(key, s); mEditor.putString(key, s);
mEditor.commit();
} }
} }
......
...@@ -5,6 +5,7 @@ import android.animation.ValueAnimator; ...@@ -5,6 +5,7 @@ import android.animation.ValueAnimator;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
...@@ -20,6 +21,9 @@ import android.widget.RelativeLayout; ...@@ -20,6 +21,9 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.maile.jingcai.R; import com.maile.jingcai.R;
import com.maile.jingcai.module.WrapperRspEntity;
import com.maile.jingcai.module.api.LoginApiService;
import com.maile.jingcai.module.net.RetrofitManager;
import com.maile.jingcai.util.DrawUtil; import com.maile.jingcai.util.DrawUtil;
import com.maile.jingcai.util.preferences.IPreferencesIds; import com.maile.jingcai.util.preferences.IPreferencesIds;
import com.maile.jingcai.util.preferences.PreferencesManager; import com.maile.jingcai.util.preferences.PreferencesManager;
...@@ -29,12 +33,15 @@ import com.maile.jingcai.view.layer.PhoneLayer; ...@@ -29,12 +33,15 @@ import com.maile.jingcai.view.layer.PhoneLayer;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.InjectView; import butterknife.InjectView;
import rx.Observer;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
public class LoginActivity extends Activity implements ILoginView { public class LoginActivity extends Activity implements ILoginView {
private final int DURATION_ANIM_OUT_START = 400; private final int DURATION_ANIM_OUT_START = 400;
private final int DURATION_ANIM_IN_LOGIN = 400; private final int DURATION_ANIM_IN_LOGIN = 1200;
private final int HANDLER_MAG_HIDE_ERRORBAR = 1; private final int HANDLER_MAG_HIDE_ERRORBAR = 1;
private final int DURATION_ANIM_ERROR = 300; private final int DURATION_ANIM_ERROR = 300;
@InjectView(R.id.main_layer) @InjectView(R.id.main_layer)
...@@ -124,15 +131,46 @@ public class LoginActivity extends Activity implements ILoginView { ...@@ -124,15 +131,46 @@ public class LoginActivity extends Activity implements ILoginView {
PreferencesManager preferencesManager = PreferencesManager.getSharedPreference(getApplication(), PreferencesManager preferencesManager = PreferencesManager.getSharedPreference(getApplication(),
IPreferencesIds.DEFAULT_SHAREPREFERENCES_FILE, IPreferencesIds.DEFAULT_SHAREPREFERENCES_FILE,
Context.MODE_PRIVATE); Context.MODE_PRIVATE);
boolean isLogin = preferencesManager.getBoolean(IPreferencesIds.IS_LOGIN, false); String token = preferencesManager.getString(IPreferencesIds.TOKEN, "");
if (isLogin) { String openid_phone = preferencesManager.getString(IPreferencesIds.openid_phone,"");
onStartMainActivity(); Log.d("tangwen", "checkUserIsLogin: token = " + token + " openid_phone = " + openid_phone);
//7天过期时间
if (!token.equals("")) {
//调用自动登录接口
autoLogin(token);
} else { } else {
//开启动画:显示登录入口 //开启动画:显示登录入口
mainLayer.startAnimToLogin(); mainLayer.startAnimToLogin();
} }
} }
//自动登录
private void autoLogin(String token){
// 手机 phone + token
// 微信 openid + token
RetrofitManager.getInstance().createReq(LoginApiService.class).autoLogin(token).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<WrapperRspEntity<String>>() {
@Override
public void onCompleted() {
onUpdateErrorBar(false, "");
}
@Override
public void onError(Throwable e) {
onUpdateErrorBar(true,e.getMessage());
mainLayer.startAnimToLogin();//如果自动登录失败:显示登录入口
}
@Override
public void onNext(WrapperRspEntity<String> userWrapperRspEntity) {
Log.i("tangwen", "onNext: " + userWrapperRspEntity.getData().toString());
onStartMainActivity();
}
});
}
@Override @Override
protected void onDestroy() { protected void onDestroy() {
......
package com.maile.jingcai.view.activity; package com.maile.jingcai.view.activity;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.RelativeLayout;
import com.flyco.tablayout.CommonTabLayout; import com.flyco.tablayout.CommonTabLayout;
import com.flyco.tablayout.listener.CustomTabEntity; import com.flyco.tablayout.listener.CustomTabEntity;
import com.flyco.tablayout.listener.OnTabSelectListener; import com.flyco.tablayout.listener.OnTabSelectListener;
import com.flyco.tablayout.utils.UnreadMsgUtils;
import com.flyco.tablayout.widget.MsgView;
import com.maile.jingcai.R; import com.maile.jingcai.R;
import com.maile.jingcai.module.entity.TabEntity; import com.maile.jingcai.module.entity.TabEntity;
import com.maile.jingcai.util.PublicUtils;
import com.maile.jingcai.view.ViewFindUtils; import com.maile.jingcai.view.ViewFindUtils;
import com.maile.jingcai.view.fragment.SimpleCardFragment; import com.maile.jingcai.view.fragment.SimpleCardFragment;
...@@ -29,6 +26,7 @@ import java.util.ArrayList; ...@@ -29,6 +26,7 @@ import java.util.ArrayList;
import java.util.Random; import java.util.Random;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.InjectView;
/** /**
* Created by chengfeng-piaopiao on 2017/11/8. * Created by chengfeng-piaopiao on 2017/11/8.
...@@ -38,19 +36,21 @@ public class MainActivity extends FragmentActivity { ...@@ -38,19 +36,21 @@ public class MainActivity extends FragmentActivity {
private Context mContext = this; private Context mContext = this;
private ArrayList<Fragment> mFragments = new ArrayList<>(); private ArrayList<Fragment> mFragments = new ArrayList<>();
private ArrayList<Fragment> mFragments2 = new ArrayList<>();
private String[] mTitles = {"首页", "消息", "联系人", "更多"}; private String[] mTitles = {"大厅", "商城", "我的"};
private int[] mIconUnselectIds = { private int[] mIconUnselectIds = {
R.mipmap.tab_home_unselect, R.mipmap.tab_speech_unselect, R.mipmap.unselect_gamepad, R.mipmap.unselect_shoppingcart,
R.mipmap.tab_contact_unselect, R.mipmap.tab_more_unselect}; R.mipmap.unselect_user, R.mipmap.tab_more_unselect};
private int[] mIconSelectIds = { private int[] mIconSelectIds = {
R.mipmap.tab_home_select, R.mipmap.tab_speech_select, R.mipmap.select_gamepad, R.mipmap.select_shoppingcart,
R.mipmap.tab_contact_select, R.mipmap.tab_more_select}; R.mipmap.select_user, R.mipmap.tab_more_select};
private ArrayList<CustomTabEntity> mTabEntities = new ArrayList<>(); private ArrayList<CustomTabEntity> mTabEntities = new ArrayList<>();
private View mDecorView; private View mDecorView;
private ViewPager mViewPager; private ViewPager mViewPager;
private CommonTabLayout mTabLayout_2; private CommonTabLayout mTabLayout_2;
private long exitTime;
private String[] urls = {"http://h5.test.7peng.cn/","http://www.mailejifen.com/","http://h5.test.7peng.cn/profile.html"};
@Override @Override
...@@ -59,16 +59,15 @@ public class MainActivity extends FragmentActivity { ...@@ -59,16 +59,15 @@ public class MainActivity extends FragmentActivity {
//设置无标题 //设置无标题
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
//设置全屏 //设置全屏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, // getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); // WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
ButterKnife.inject(this); ButterKnife.inject(this);
for (String title : mTitles) {
mFragments.add(SimpleCardFragment.getInstance("Switch ViewPager " + title));
mFragments2.add(SimpleCardFragment.getInstance("Switch Fragment " + title));
}
for (int i = 0 ; i < mTitles.length; i ++){
mFragments.add(SimpleCardFragment.getInstance(mTitles[i],urls[i]));
}
for (int i = 0; i < mTitles.length; i++) { for (int i = 0; i < mTitles.length; i++) {
mTabEntities.add(new TabEntity(mTitles[i], mIconSelectIds[i], mIconUnselectIds[i])); mTabEntities.add(new TabEntity(mTitles[i], mIconSelectIds[i], mIconUnselectIds[i]));
...@@ -76,37 +75,35 @@ public class MainActivity extends FragmentActivity { ...@@ -76,37 +75,35 @@ public class MainActivity extends FragmentActivity {
mDecorView = getWindow().getDecorView(); mDecorView = getWindow().getDecorView();
mViewPager = ViewFindUtils.find(mDecorView, R.id.vp_2); mViewPager = ViewFindUtils.find(mDecorView, R.id.vp_2);
mViewPager.setOffscreenPageLimit(2);
mViewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager())); mViewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager()));
/** with nothing */ /** with nothing */
/** with ViewPager */ /** with ViewPager */
mTabLayout_2 = ViewFindUtils.find(mDecorView, R.id.tl_2); mTabLayout_2 = ViewFindUtils.find(mDecorView, R.id.tl_2);
;
tl_2(); tl_2();
// //两位数
//两位数 // mTabLayout_2.showMsg(0, 55);
mTabLayout_2.showMsg(0, 55); // mTabLayout_2.setMsgMargin(0, -5, 5);
mTabLayout_2.setMsgMargin(0, -5, 5); //
// //三位数
//三位数 // mTabLayout_2.showMsg(1, 100);
mTabLayout_2.showMsg(1, 100); // mTabLayout_2.setMsgMargin(1, -5, 5);
mTabLayout_2.setMsgMargin(1, -5, 5); //
// //设置未读消息红点
//设置未读消息红点 // mTabLayout_2.showDot(2);
mTabLayout_2.showDot(2); // MsgView rtv_2_2 = mTabLayout_2.getMsgView(2);
MsgView rtv_2_2 = mTabLayout_2.getMsgView(2); // if (rtv_2_2 != null) {
if (rtv_2_2 != null) { // UnreadMsgUtils.setSize(rtv_2_2, dp2px(7.5f));
UnreadMsgUtils.setSize(rtv_2_2, dp2px(7.5f)); // }
} //
// //设置未读消息背景
//设置未读消息背景 // mTabLayout_2.showMsg(3, 5);
mTabLayout_2.showMsg(3, 5); // mTabLayout_2.setMsgMargin(3, 0, 5);
mTabLayout_2.setMsgMargin(3, 0, 5); // MsgView rtv_2_3 = mTabLayout_2.getMsgView(3);
MsgView rtv_2_3 = mTabLayout_2.getMsgView(3); // if (rtv_2_3 != null) {
if (rtv_2_3 != null) { // rtv_2_3.setBackgroundColor(Color.parseColor("#6D8FB0"));
rtv_2_3.setBackgroundColor(Color.parseColor("#6D8FB0")); // }
}
} }
Random mRandom = new Random(); Random mRandom = new Random();
...@@ -145,7 +142,7 @@ public class MainActivity extends FragmentActivity { ...@@ -145,7 +142,7 @@ public class MainActivity extends FragmentActivity {
} }
}); });
mViewPager.setCurrentItem(1); mViewPager.setCurrentItem(0);
} }
private class MyPagerAdapter extends FragmentPagerAdapter { private class MyPagerAdapter extends FragmentPagerAdapter {
...@@ -173,4 +170,24 @@ public class MainActivity extends FragmentActivity { ...@@ -173,4 +170,24 @@ public class MainActivity extends FragmentActivity {
final float scale = mContext.getResources().getDisplayMetrics().density; final float scale = mContext.getResources().getDisplayMetrics().density;
return (int) (dp * scale + 0.5f); return (int) (dp * scale + 0.5f);
} }
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
int currentItem = mViewPager.getCurrentItem();
SimpleCardFragment fragment = (SimpleCardFragment) mFragments.get(currentItem);
if (!fragment.tryWebViewGoBack()) {
Long now = System.currentTimeMillis();
if (now - exitTime > 1000) {
PublicUtils.showToast("再按一次退出");
exitTime = now;
} else if (now - exitTime > 300) {
finish();
}
}
return false;
}
return super.onKeyDown(keyCode, event);
}
} }
package com.maile.jingcai.view.fragment; package com.maile.jingcai.view.fragment;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.util.Log;
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.TextView; import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import com.maile.jingcai.R; import com.maile.jingcai.R;
import com.maile.jingcai.base.BaseFragment;
import com.maile.jingcai.module.WrapperRspEntity;
import com.maile.jingcai.module.api.LoginApiService;
import com.maile.jingcai.module.net.RetrofitManager;
import com.maile.jingcai.util.PublicUtils;
import com.maile.jingcai.util.preferences.IPreferencesIds;
import com.maile.jingcai.util.preferences.PreferencesManager;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import butterknife.ButterKnife;
import butterknife.InjectView;
import rx.Observer;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
public class SimpleCardFragment extends BaseFragment {
@InjectView(R.id.webView_progress)
ProgressBar mWebViewProgress;
@InjectView(R.id.webView)
WebView mWebView;
@InjectView(R.id.rl_loading_layout)
RelativeLayout mLoading;
@SuppressLint("ValidFragment")
public class SimpleCardFragment extends Fragment {
private String mTitle; private String mTitle;
private String mUrl;
public static SimpleCardFragment getInstance(String title) {
public static SimpleCardFragment getInstance(String title,String mUrl) {
SimpleCardFragment sf = new SimpleCardFragment(); SimpleCardFragment sf = new SimpleCardFragment();
sf.mTitle = title; sf.mTitle = title;
sf.mUrl = mUrl;
return sf; return sf;
} }
@Override @Override
public void onCreate(Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreate(savedInstanceState); View view = inflater.inflate(R.layout.fr_simple_card, container, false);
ButterKnife.inject(this, view);
mLoading.setVisibility(View.VISIBLE);
loadWebView(mUrl);
return view;
} }
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fr_simple_card, null); super.onViewCreated(view, savedInstanceState);
TextView card_title_tv = (TextView) v.findViewById(R.id.card_title_tv); // loadWebView(mUrl);
card_title_tv.setText(mTitle); }
//加载webview
@SuppressLint("AddJavascriptInterface")
private void loadWebView(String url) {
mWebView.setVisibility(View.VISIBLE);
WebSettings webSettings = mWebView.getSettings();
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setJavaScriptEnabled(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setDomStorageEnabled(true);
// 以下两句,解决4.4以上放大错乱问题
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setSupportZoom(false);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
webSettings.setAllowFileAccess(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW );
}
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
mWebView.getSettings().setAllowUniversalAccessFromFileURLs(true);
}else{
try {
Class<?> clazz = mWebView.getSettings().getClass();
Method method = clazz.getMethod("setAllowUniversalAccessFromFileURLs", boolean.class);
if (method != null) {
method.invoke(mWebView.getSettings(), true);
}
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
//WebView加载web资源
mWebView.loadUrl(url);
//覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为,使网页用WebView打开
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
//返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器
view.loadUrl(url);
return true;
}
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
super.onReceivedError(view, errorCode, description, failingUrl);
if (null != mWebViewProgress) {
mWebViewProgress.setVisibility(View.GONE);
}
}
@Override
public void onPageFinished(WebView view, String url) {
mLoading.setVisibility(View.INVISIBLE);
// super.onPageFinished(view, url);
if(!mUrl.equals("http://h5.test.7peng.cn/")){
return;
}
isLoading = true;
PreferencesManager preferencesManager = PreferencesManager.getSharedPreference(getContext(),
IPreferencesIds.DEFAULT_SHAREPREFERENCES_FILE,
Context.MODE_PRIVATE);
final String token = preferencesManager.getString(IPreferencesIds.TOKEN, "");
Log.i("ggg", "onPageFinished: " + "ggg");
new Handler().postDelayed(new Runnable(){
public void run() {
//mWebView.loadUrl("javascript:console.log('ggg'); (function(){localStorage.setItem(\"__token__\", '"+token+"');})();");
mWebView.loadUrl("javascript:console.log('type:'+ typeof(window.h5AutoLogin));h5AutoLogin('"+token+"')");
}
}, 2000);
//mWebView.loadUrl("javascript:console.log('ggg');h5AutoLogin('"+token+"')");
// RetrofitManager.getInstance().createReq(LoginApiService.class).h5AutoLogin(token).subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new Observer<WrapperRspEntity<String>>() {
// @Override
// public void onCompleted() {
// }
//
// @Override
// public void onError(Throwable e) {
//
// }
//
// @Override
// public void onNext(WrapperRspEntity<String> userWrapperRspEntity) {
//
// }
// });
}
});
mWebView.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
if (newProgress == 100 && null != mWebViewProgress) {
// 网页加载完成
mWebViewProgress.setVisibility(View.GONE);
} else {
// 加载中
if (view != null && view.getUrl() != null && !view.getUrl().contains(":blank")) {
if (null != mWebViewProgress) {
mWebViewProgress.setVisibility(View.VISIBLE);
mWebViewProgress.setProgress(newProgress);
}
}
}
}
@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
Log.i("tangwen", "<WebViewActivity> onJsAlert");
return super.onJsAlert(view, url, message, result);
}
});
}
@Override
public void onDestroyView() {
super.onDestroyView();
ButterKnife.reset(this);
if (null != mWebView) {
mWebView.destroy();
mWebView = null;
}
}
return v; public boolean tryWebViewGoBack() {
if (mWebView.canGoBack()) {
mWebView.goBack();
return true;
}
return false;
} }
} }
\ No newline at end of file
...@@ -79,7 +79,7 @@ public class LoginMainLayer extends RelativeLayout { ...@@ -79,7 +79,7 @@ public class LoginMainLayer extends RelativeLayout {
mWeixinLogining = false; mWeixinLogining = false;
View view = LayoutInflater.from(context).inflate(R.layout.layour_login_main, this); View view = LayoutInflater.from(context).inflate(R.layout.layour_login_main, this);
ButterKnife.inject(view,this); ButterKnife.inject(view,this);
startAnimToLogin();
} }
public void setIoginView (ILoginView view ,Activity activity){ public void setIoginView (ILoginView view ,Activity activity){
......
...@@ -30,6 +30,9 @@ import com.maile.jingcai.module.net.RetrofitManager; ...@@ -30,6 +30,9 @@ import com.maile.jingcai.module.net.RetrofitManager;
import com.maile.jingcai.util.NetUtils; import com.maile.jingcai.util.NetUtils;
import com.maile.jingcai.util.PublicUtils; import com.maile.jingcai.util.PublicUtils;
import com.maile.jingcai.util.UtilTool; import com.maile.jingcai.util.UtilTool;
import com.maile.jingcai.util.preferences.IPreferencesIds;
import com.maile.jingcai.util.preferences.PreferencesManager;
import com.maile.jingcai.view.activity.LoginActivity;
import com.maile.jingcai.view.iview.ILoginView; import com.maile.jingcai.view.iview.ILoginView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.InjectView; import butterknife.InjectView;
...@@ -106,7 +109,7 @@ public class PhoneLayer extends RelativeLayout implements View.OnFocusChangeLi ...@@ -106,7 +109,7 @@ public class PhoneLayer extends RelativeLayout implements View.OnFocusChangeLi
@OnClick(R.id.btn_login_phone) @OnClick(R.id.btn_login_phone)
public void login(){ public void login(){
String phoneNumber = PublicUtils.removeAllSpace(mInputPhone.getText().toString().trim()); final String phoneNumber = PublicUtils.removeAllSpace(mInputPhone.getText().toString().trim());
String code = PublicUtils.removeAllSpace( mInputCheckcode.getText().toString().trim()); String code = PublicUtils.removeAllSpace( mInputCheckcode.getText().toString().trim());
if(checkIsValid(phoneNumber,code)){ if(checkIsValid(phoneNumber,code)){
mLoginView.onShowLoadingView(true); mLoginView.onShowLoadingView(true);
...@@ -129,6 +132,17 @@ public class PhoneLayer extends RelativeLayout implements View.OnFocusChangeLi ...@@ -129,6 +132,17 @@ public class PhoneLayer extends RelativeLayout implements View.OnFocusChangeLi
@Override @Override
public void onNext(WrapperRspEntity<String> userWrapperRspEntity) { public void onNext(WrapperRspEntity<String> userWrapperRspEntity) {
mLoginView.onStartMainActivity(); mLoginView.onStartMainActivity();
Log.i("tangwen", "login[/token]: " + userWrapperRspEntity.getData().toString());
if(userWrapperRspEntity == null || userWrapperRspEntity.getData().equals("")){
PublicUtils.showToast(getContext().getString(R.string.error_login_error));
}else{
PreferencesManager preferencesManager = PreferencesManager.getSharedPreference(getContext(),
IPreferencesIds.DEFAULT_SHAREPREFERENCES_FILE,
Context.MODE_PRIVATE);
preferencesManager.putString(IPreferencesIds.TOKEN,userWrapperRspEntity.getData());
preferencesManager.putString(IPreferencesIds.openid_phone, phoneNumber);
mLoginView.onStartMainActivity();
}
} }
}); });
} }
...@@ -296,7 +310,6 @@ public class PhoneLayer extends RelativeLayout implements View.OnFocusChangeLi ...@@ -296,7 +310,6 @@ public class PhoneLayer extends RelativeLayout implements View.OnFocusChangeLi
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {
Log.i("tangwen", "onError: "+ e.getMessage());
showError(e.getMessage()); showError(e.getMessage());
//com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was 服务端定义的数据格式和客户端不一致 //com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was 服务端定义的数据格式和客户端不一致
//class java.net.ConnectException //class java.net.ConnectException
...@@ -304,7 +317,9 @@ public class PhoneLayer extends RelativeLayout implements View.OnFocusChangeLi ...@@ -304,7 +317,9 @@ public class PhoneLayer extends RelativeLayout implements View.OnFocusChangeLi
@Override @Override
public void onNext(WrapperRspEntity<String> userWrapperRspEntity) { public void onNext(WrapperRspEntity<String> userWrapperRspEntity) {
Log.i("tangwen", "onNext: " + userWrapperRspEntity.toString()); Log.i("tangwen", "onNext: " + userWrapperRspEntity.getData().toString());
} }
}); });
} }
......
...@@ -18,6 +18,8 @@ import com.maile.jingcai.module.WrapperRspEntity; ...@@ -18,6 +18,8 @@ import com.maile.jingcai.module.WrapperRspEntity;
import com.maile.jingcai.module.api.LoginApiService; import com.maile.jingcai.module.api.LoginApiService;
import com.maile.jingcai.module.net.RetrofitManager; import com.maile.jingcai.module.net.RetrofitManager;
import com.maile.jingcai.util.PublicUtils; import com.maile.jingcai.util.PublicUtils;
import com.maile.jingcai.util.preferences.IPreferencesIds;
import com.maile.jingcai.util.preferences.PreferencesManager;
import com.maile.jingcai.view.activity.LoginActivity; import com.maile.jingcai.view.activity.LoginActivity;
import com.maile.jingcai.view.activity.MainActivity; import com.maile.jingcai.view.activity.MainActivity;
import com.tencent.mm.opensdk.constants.ConstantsAPI; import com.tencent.mm.opensdk.constants.ConstantsAPI;
...@@ -57,6 +59,7 @@ import rx.schedulers.Schedulers; ...@@ -57,6 +59,7 @@ import rx.schedulers.Schedulers;
* 此时WXEntryActivity中的public void onResp(BaseResp resp)方法被调用(微信、朋友圈分享成功后,此方法同样会被调用), * 此时WXEntryActivity中的public void onResp(BaseResp resp)方法被调用(微信、朋友圈分享成功后,此方法同样会被调用),
*/ */
public class WXEntryActivity extends Activity implements IWXAPIEventHandler { public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
private static final String TAG = "tangwen";
private IWXAPI sApi; private IWXAPI sApi;
// 获取第一步的code后,请求以下链接获取access_token // 获取第一步的code后,请求以下链接获取access_token
public static String GetCodeRequest = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code"; public static String GetCodeRequest = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
...@@ -260,7 +263,6 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler { ...@@ -260,7 +263,6 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
String channel = "android";; String channel = "android";;
String accounType = "weixin"; String accounType = "weixin";
try { try {
HttpGet getMethod = new HttpGet(get_user_info_url); HttpGet getMethod = new HttpGet(get_user_info_url);
HttpResponse response = get_access_token_httpClient.execute(getMethod); // 执行GET方法 HttpResponse response = get_access_token_httpClient.execute(getMethod); // 执行GET方法
...@@ -284,19 +286,19 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler { ...@@ -284,19 +286,19 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
Log.i("tangwen", "<WXEntryActivity> openid= " + openid + Log.i("tangwen", "<WXEntryActivity> openid= " + openid +
" nickname= " + nickname + " headimgurl= " + headimgurl + " mCode =" + mCode + " mAccessToken = " + mAccessToken); " nickname= " + nickname + " headimgurl= " + headimgurl + " mCode =" + mCode + " mAccessToken = " + mAccessToken);
final String finalOpenid = openid;
RetrofitManager.getInstance().createReq(LoginApiService.class).thirdLogin(channel,openid,accounType,headimgurl,nickname).subscribeOn(Schedulers.io()) RetrofitManager.getInstance().createReq(LoginApiService.class).thirdLogin(channel,openid,accounType,headimgurl,nickname).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<WrapperRspEntity<String>>() { .subscribe(new Observer<WrapperRspEntity<String>>() {
@Override @Override
public void onCompleted() { public void onCompleted() {
Log.d("tangwen", "onCompleted: "); Log.d("tangwen", "onCompleted");
} }
@Override @Override
public void onError(Throwable errorException) { public void onError(Throwable errorException) {
LoginActivity.startEntranceActivity(mContext); LoginActivity.startEntranceActivity(mContext);
mLoading.setVisibility(View.GONE); mLoading.setVisibility(View.GONE);
finish();
Log.d("tangwen", "onError: " + errorException.getMessage()); Log.d("tangwen", "onError: " + errorException.getMessage());
if (errorException == null) { if (errorException == null) {
PublicUtils.showToast(getString(R.string.error_server_not_ok)); PublicUtils.showToast(getString(R.string.error_server_not_ok));
...@@ -307,24 +309,35 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler { ...@@ -307,24 +309,35 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
} else { } else {
PublicUtils.showToast(getString(R.string.error_server_not_ok)); PublicUtils.showToast(getString(R.string.error_server_not_ok));
} }
finish();
} }
@Override @Override
public void onNext(WrapperRspEntity<String> userWrapperRspEntity) { public void onNext(final WrapperRspEntity<String> userWrapperRspEntity) {
Log.d("tangwen", "onCompleted: " + userWrapperRspEntity.toString()); Log.d("tangwen", "onCompleted: " + userWrapperRspEntity.toString());
Log.d(TAG, "mIsDestroy: " + mIsDestroy);
if (mIsDestroy) { if (mIsDestroy) {
return; return;
} }
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
LoginActivity.startEntranceActivity(mContext); if(userWrapperRspEntity == null || userWrapperRspEntity.getData().equals("")){
PublicUtils.showToast(getString(R.string.error_upload_user_info_not_ok));
}else{
PreferencesManager preferencesManager = PreferencesManager.getSharedPreference(getApplication(),
IPreferencesIds.DEFAULT_SHAREPREFERENCES_FILE,
Context.MODE_PRIVATE);
preferencesManager.putString(IPreferencesIds.TOKEN,userWrapperRspEntity.getData());
preferencesManager.putString(IPreferencesIds.openid_phone, finalOpenid);
LoginActivity.startEntranceActivity(mContext);
}
mLoading.setVisibility(View.GONE); mLoading.setVisibility(View.GONE);
finish();
} }
}); });
} }
}); });
} else { } else {
} }
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@android:id/background">
<shape>
<corners android:radius="5dip" />
<gradient
android:angle="270"
android:centerY="0.75"
android:endColor="#f6f6f6"
android:startColor="#f6f6f6" />
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<corners android:radius="0dip" />
<gradient
android:angle="270"
android:centerY="0.75"
android:endColor="#165CBC"
android:startColor="#85B0E9" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="5dip" />
<gradient
android:angle="270"
android:centerY="0.75"
android:endColor="#ffba42"
android:startColor="#ffba42" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:background="#FFFFFF"
tools:context=".view.activity.MainActivity"> tools:context=".view.activity.MainActivity">
<LinearLayout <LinearLayout
...@@ -14,7 +15,7 @@ ...@@ -14,7 +15,7 @@
android:id="@+id/vp_2" android:id="@+id/vp_2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingBottom="70dp" android:paddingBottom="60dp"
/> />
</LinearLayout> </LinearLayout>
...@@ -22,16 +23,16 @@ ...@@ -22,16 +23,16 @@
<com.flyco.tablayout.CommonTabLayout <com.flyco.tablayout.CommonTabLayout
android:id="@+id/tl_2" android:id="@+id/tl_2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="60dp"
android:background="#ffffff" android:background="#ffffff"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
tl:tl_iconHeight="23dp" tl:tl_iconHeight="35dp"
tl:tl_iconWidth="23dp" tl:tl_iconWidth="35dp"
tl:tl_indicator_color="#2C97DE" tl:tl_indicator_color="#2C97DE"
tl:tl_indicator_height="0dp" tl:tl_indicator_height="0dp"
tl:tl_textSelectColor="#2C97DE" tl:tl_textSelectColor="#2C97DE"
tl:tl_textUnselectColor="#66000000" tl:tl_textUnselectColor="#66000000"
tl:tl_textsize="12sp" tl:tl_textsize="14sp"
tl:tl_underline_color="#DDDDDD" tl:tl_underline_color="#DDDDDD"
tl:tl_underline_height="1dp"/> tl:tl_underline_height="1dp"/>
......
<RelativeLayout <RelativeLayout
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout
<TextView android:layout_width="match_parent"
android:id="@+id/card_title_tv" android:layout_height="match_parent">
<ProgressBar
android:id="@+id/webView_progress"
style="@style/ProgressBar_Mini"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:progress="50"
android:visibility="gone"/>
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible">
</WebView>
</LinearLayout>
<include
layout="@layout/layout_loading"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
android:layout_margin="10dp" </RelativeLayout>
android:background="@drawable/background_card"
android:gravity="center"
android:textSize="18sp"/>
</RelativeLayout>
\ No newline at end of file

3.34 KB | W: | H:

26.5 KB | W: | H:

app/src/main/res/mipmap-hdpi/ic_launcher.png
app/src/main/res/mipmap-hdpi/ic_launcher.png
app/src/main/res/mipmap-hdpi/ic_launcher.png
app/src/main/res/mipmap-hdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

2.15 KB | W: | H:

26.5 KB | W: | H:

app/src/main/res/mipmap-mdpi/ic_launcher.png
app/src/main/res/mipmap-mdpi/ic_launcher.png
app/src/main/res/mipmap-mdpi/ic_launcher.png
app/src/main/res/mipmap-mdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

4.73 KB | W: | H:

26.5 KB | W: | H:

app/src/main/res/mipmap-xhdpi/ic_launcher.png
app/src/main/res/mipmap-xhdpi/ic_launcher.png
app/src/main/res/mipmap-xhdpi/ic_launcher.png
app/src/main/res/mipmap-xhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

7.54 KB | W: | H:

26.5 KB | W: | H:

app/src/main/res/mipmap-xxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin

10.2 KB | W: | H:

26.5 KB | W: | H:

app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
<resources> <resources>
<string name="app_name">DuoBaoJingCai</string> <string name="app_name">夺宝竞猜</string>
<string name="login_phone">手机登录</string> <string name="login_phone">手机登录</string>
<string name="login_weixin">微信登录</string> <string name="login_weixin">微信登录</string>
<string name="login_input_password_hint">密码</string> <string name="login_input_password_hint">密码</string>
...@@ -16,5 +16,7 @@ ...@@ -16,5 +16,7 @@
<string name="error_server_not_ok">服务器开小差了</string> <string name="error_server_not_ok">服务器开小差了</string>
<string name="error_server_timeout_error">请求超时</string> <string name="error_server_timeout_error">请求超时</string>
<string name="user_error_input_code">请输入验证码</string> <string name="user_error_input_code">请输入验证码</string>
<string name="error_upload_user_info_not_ok">用户信息上传失败</string>
<string name="error_login_error">登录失败</string>
</resources> </resources>
...@@ -8,4 +8,14 @@ ...@@ -8,4 +8,14 @@
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
</style> </style>
<style name="ProgressBar_Mini" parent="@android:style/Widget.Holo.ProgressBar.Horizontal">
<item name="android:maxHeight">8dip</item>
<item name="android:minHeight">4dip</item>
<item name="android:indeterminateOnly">false</item>
<item name="android:indeterminateDrawable">
@android:drawable/progress_indeterminate_horizontal
</item>
<item name="android:progressDrawable">@drawable/progressbar_mini</item>
</style>
</resources> </resources>
...@@ -5,7 +5,7 @@ buildscript { ...@@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.1.0' classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
......
#Mon Dec 28 10:00:20 PST 2015 #Fri Nov 10 16:23:30 CST 2017
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment