第一次提交
@@ -0,0 +1,26 @@
|
||||
package com.bikao.cleanmark;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.bikao.watermark", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
73
app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.dskj.daikuan">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<!-- <uses-permission android:name="android.permission.CALL_PHONE"/>-->
|
||||
|
||||
<application
|
||||
android:name=".InitApp"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/logo_img"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:roundIcon="@mipmap/logo_img"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppThemeLogin"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:allowBackup">
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.google.android.actions"-->
|
||||
<!-- android:resource="@xml/animate" />-->
|
||||
|
||||
<uses-library
|
||||
android:name="org.apache.http.legacy"
|
||||
android:required="false" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.activity.StartUpActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.dskj.daikuan.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true"
|
||||
tools:replace="android:authorities">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths"
|
||||
tools:replace="android:resource" />
|
||||
</provider>
|
||||
|
||||
<activity
|
||||
android:name=".ui.activity.MainActivity"
|
||||
android:exported="true"></activity>
|
||||
<activity
|
||||
android:name=".ui.activity.LoginActivity"
|
||||
android:exported="true"></activity>
|
||||
<activity
|
||||
android:name=".ui.activity.ShenQingActivity"
|
||||
android:exported="true"></activity>
|
||||
<activity
|
||||
android:name=".ui.activity.XiangQingActivity"
|
||||
android:exported="true"></activity>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
156
app/src/main/java/com/dskj/daikuan/InitApp.java
Normal file
@@ -0,0 +1,156 @@
|
||||
package com.dskj.daikuan;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.dskj.daikuan.bean.UserBean;
|
||||
import com.dskj.daikuan.config.Config;
|
||||
import com.dskj.daikuan.utils.DeviceUtil;
|
||||
import com.dskj.daikuan.utils.GsonUtils;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Application 主入口
|
||||
*
|
||||
* @author xuhuixiang
|
||||
*/
|
||||
|
||||
public class InitApp extends Application {
|
||||
public static Context AppContext;
|
||||
public static InitApp initApp;
|
||||
|
||||
public static Context getAppContext() {
|
||||
return AppContext;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
AppContext = getApplicationContext();
|
||||
initApp = this;
|
||||
DeviceUtil.init(this);
|
||||
initARouter();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initARouter() {
|
||||
|
||||
}
|
||||
|
||||
//----------------------------SharedPreferences的全局存储实现 人懒 懒得抽文件---------------------------------------
|
||||
|
||||
public static void saveInt(String key, int value) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putInt(key, value);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static void saveFloat(String key, float value) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putFloat(key, value);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static void saveLong(String key, long value) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putLong(key, value);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static void saveString(String key, String value) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putString(key, value);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static void deleteKey(String key) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
if (!sp.contains(key)) return;
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.remove(key);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static void saveBoolean(String key, boolean value) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putBoolean(key, value);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static int getInt(String key, int defValue) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
return sp.getInt(key, defValue);
|
||||
}
|
||||
|
||||
public static float getFloat(String key, float defValue) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
return sp.getFloat(key, defValue);
|
||||
}
|
||||
|
||||
public static long getLong(String key, long defValue) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
return sp.getLong(key, defValue);
|
||||
}
|
||||
|
||||
public static boolean getBoolean(String key, boolean defValue) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
return sp.getBoolean(key, defValue);
|
||||
}
|
||||
|
||||
public static String getString(String key, String defValue) {
|
||||
Context context = AppContext;
|
||||
if (context == null) {
|
||||
return defValue;
|
||||
}
|
||||
SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
return sp.getString(key, defValue);
|
||||
}
|
||||
|
||||
public static UserBean getUserBean() {
|
||||
Context context = AppContext;
|
||||
if (context == null) {
|
||||
return null;
|
||||
}
|
||||
String name = getString("user_bean","");
|
||||
if(TextUtils.isEmpty(name)){
|
||||
return null;
|
||||
}
|
||||
return GsonUtils.getObjFromJSON(name,UserBean.class);
|
||||
}
|
||||
|
||||
public static String getToken() {
|
||||
Context context = AppContext;
|
||||
if (context == null) {
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void setToken(String value) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putString(Config.API_TOKEN_TAG, value);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
}
|
||||
68
app/src/main/java/com/dskj/daikuan/adapter/BaseAdapter.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package com.dskj.daikuan.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public abstract class BaseAdapter extends RecyclerView.Adapter implements View.OnClickListener, View.OnLongClickListener {
|
||||
|
||||
private Context mContext;
|
||||
private OnItemClickListener mItemClickListener;
|
||||
|
||||
public BaseAdapter(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public abstract RecyclerView.ViewHolder getViewHolder(View itemView);
|
||||
|
||||
public abstract int getItemViewResource();
|
||||
|
||||
public abstract void bindItemData(RecyclerView.ViewHolder holder, int position);
|
||||
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
int resource = getItemViewResource();
|
||||
if (resource <= 0) return null;
|
||||
|
||||
View view = LayoutInflater.from(mContext).inflate(resource, parent, false);
|
||||
view.setOnClickListener(this);
|
||||
view.setOnLongClickListener(this);
|
||||
return getViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
|
||||
bindItemData(holder, position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onClick(View v) {
|
||||
if (mItemClickListener != null) {
|
||||
mItemClickListener.onItemClick(v);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
if (mItemClickListener != null) {
|
||||
mItemClickListener.onItemLongClick(v);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return mContext;
|
||||
}
|
||||
|
||||
public void setItemClickListener(OnItemClickListener itemClickListener) {
|
||||
mItemClickListener = itemClickListener;
|
||||
}
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(View v);
|
||||
void onItemLongClick(View v);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.dskj.daikuan.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CommunityAdapter extends FragmentStateAdapter {
|
||||
private ArrayList<String> listTitle;
|
||||
private List<Fragment> listFragment;
|
||||
|
||||
|
||||
public CommunityAdapter(@NonNull FragmentActivity fragmentActivity, ArrayList<String> listTitle, List<Fragment> listFragment) {
|
||||
super(fragmentActivity);
|
||||
this.listTitle = listTitle;
|
||||
this.listFragment = listFragment;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return listFragment.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listFragment.size();
|
||||
}
|
||||
|
||||
}
|
||||
34
app/src/main/java/com/dskj/daikuan/adapter/GoodsAdapter.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.dskj.daikuan.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GoodsAdapter extends FragmentStateAdapter {
|
||||
private ArrayList<String> listTitle;
|
||||
private List<Fragment> listFragment;
|
||||
|
||||
|
||||
public GoodsAdapter(@NonNull FragmentActivity fragmentActivity, ArrayList<String> listTitle, List<Fragment> listFragment) {
|
||||
super(fragmentActivity);
|
||||
this.listTitle = listTitle;
|
||||
this.listFragment = listFragment;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return listFragment.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return listFragment.size();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.dskj.daikuan.adapter.comm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通用列表适配器
|
||||
* @param <T>
|
||||
*/
|
||||
public abstract class CommonAdapter<T> extends RecyclerView.Adapter<ViewHolder> {
|
||||
|
||||
protected Context mContext;
|
||||
protected int mLayoutId;
|
||||
protected List<T> mDatas;
|
||||
protected LayoutInflater mInflater;
|
||||
|
||||
ViewHolder viewHolder;
|
||||
|
||||
|
||||
public CommonAdapter(Context context, int layoutId, List<T> datas) {
|
||||
mContext = context;
|
||||
mInflater = LayoutInflater.from(context);
|
||||
mLayoutId = layoutId;
|
||||
mDatas = datas;
|
||||
}
|
||||
public void setDates(List<T> dates){
|
||||
this.mDatas=dates;
|
||||
// notifyItemRangeChanged(0,mDatas.size());
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
public void addDates(List<T> dates){
|
||||
this.mDatas.addAll(dates);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void addDates(int localSize){
|
||||
int size=mDatas.size();
|
||||
notifyItemRangeChanged(size,localSize);
|
||||
}
|
||||
public List<T> getDates(){
|
||||
return this.mDatas;
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
viewHolder = ViewHolder.get(mContext, parent, mLayoutId);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
|
||||
convert(holder, mDatas.get(position),position);
|
||||
}
|
||||
|
||||
public abstract void convert(ViewHolder holder, T t,int index);
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDatas.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.dskj.daikuan.adapter.comm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.SparseArray;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 通用列表ViewHolder
|
||||
*/
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private SparseArray<View> mViews;
|
||||
private View mConvertView;
|
||||
private Context mContext;
|
||||
|
||||
public ViewHolder(Context context, View itemView, ViewGroup parent) {
|
||||
super(itemView);
|
||||
mContext = context;
|
||||
mConvertView = itemView;
|
||||
mViews = new SparseArray<View>();
|
||||
}
|
||||
|
||||
public static ViewHolder get(Context context, ViewGroup parent, int layoutId) {
|
||||
|
||||
View itemView = LayoutInflater.from(context).inflate(layoutId, parent,
|
||||
false);
|
||||
ViewHolder holder = new ViewHolder(context, itemView, parent);
|
||||
return holder;
|
||||
}
|
||||
|
||||
|
||||
public <T extends View> T getView(int viewId) {
|
||||
View view = mViews.get(viewId);
|
||||
if (view == null) {
|
||||
view = mConvertView.findViewById(viewId);
|
||||
mViews.put(viewId, view);
|
||||
}
|
||||
return (T) view;
|
||||
}
|
||||
|
||||
|
||||
public ViewHolder setText(int viewId, String text)
|
||||
{
|
||||
TextView tv = getView(viewId);
|
||||
tv.setText(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ViewHolder setOnClickListener(int viewId, View.OnClickListener listener) {
|
||||
View view = getView(viewId);
|
||||
view.setOnClickListener(listener);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
76
app/src/main/java/com/dskj/daikuan/api/Api.java
Normal file
@@ -0,0 +1,76 @@
|
||||
package com.dskj.daikuan.api;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.azhon.basic.retrofit.BaseApi;
|
||||
import com.dskj.daikuan.InitApp;
|
||||
import com.dskj.daikuan.config.Config;
|
||||
import com.dskj.daikuan.utils.LogUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
|
||||
/**
|
||||
* 项目名: TODO-MVVM
|
||||
* 包名 com.azhon.mvvm.api
|
||||
* 文件名: Api
|
||||
* 创建时间: 2019-03-27 on 14:56
|
||||
* 描述: TODO 使用Retrofit基础服务
|
||||
*
|
||||
*/
|
||||
|
||||
public class Api extends BaseApi {
|
||||
|
||||
private static final long CONNECT_TIMEOUT = 10;
|
||||
private static final long READ_TIMEOUT = 10;
|
||||
private static final long WRITE_TIMEOUT = 10;
|
||||
|
||||
/**
|
||||
* 静态内部类单例
|
||||
*/
|
||||
private static class ApiHolder {
|
||||
private static Api api = new Api();
|
||||
private final static ApiService apiService = api.initRetrofit(ApiService.URL)
|
||||
.create(ApiService.class);
|
||||
|
||||
}
|
||||
|
||||
public static ApiService getInstance() {
|
||||
return ApiHolder.apiService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 做自己需要的操作
|
||||
*/
|
||||
@Override
|
||||
protected OkHttpClient setClient() {
|
||||
OkHttpClient.Builder builder;
|
||||
builder = new OkHttpClient()
|
||||
.newBuilder();
|
||||
//禁止使用代理抓取数据
|
||||
// builder.proxy(Proxy.NO_PROXY);
|
||||
//设置超时
|
||||
builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS);
|
||||
builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS);
|
||||
builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS);
|
||||
//错误重连
|
||||
builder.retryOnConnectionFailure(true);
|
||||
builder.addInterceptor(new HeaderInterceptor());
|
||||
|
||||
if(Config.IS_DEBUG) {
|
||||
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> {
|
||||
String text = message;
|
||||
LogUtils.i("OKHttp111111-----", text);
|
||||
});
|
||||
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||
builder.addInterceptor(interceptor);
|
||||
}
|
||||
return builder.build();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
42
app/src/main/java/com/dskj/daikuan/api/ApiService.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package com.dskj.daikuan.api;
|
||||
|
||||
|
||||
import com.dskj.daikuan.bean.VideoIndexResult;
|
||||
import com.dskj.daikuan.bean.VideoResult;
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* 项目名:
|
||||
* 包名 com.azhon.mvvm.api
|
||||
* 文件名: ApiService
|
||||
* 创建时间: 2019-03-27 on 14:55
|
||||
* 描述:
|
||||
*
|
||||
*/
|
||||
|
||||
public interface ApiService {
|
||||
|
||||
// String URL="https://www.csyltest.com/";
|
||||
String URL="https://8660ee.vip/";
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("frontend/video/index")
|
||||
Observable<Result<VideoIndexResult>> videoIndex(@Field("token") String token);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("frontend/video/list")
|
||||
Observable<Result<VideoResult>> videoList(@Field("token") String token, @Field("id") String id, @Field("op") String op,
|
||||
@Field("page") String page, @Field("nogame") String nogame);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("https://www.csyltest.com/frontend/video/search")
|
||||
Observable<Result<VideoResult>> search(@Field("token") String token,@Field("key") String key,
|
||||
@Field("pagesize") String pagesize, @Field("page") String page, @Field("op") String op);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("frontend/video/videoPlay")
|
||||
Observable<Result> videoPlay(@Field("token") String token,@Field("id") String id);
|
||||
}
|
||||
114
app/src/main/java/com/dskj/daikuan/api/BaseObserver.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package com.dskj.daikuan.api;
|
||||
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import org.json.JSONException;
|
||||
|
||||
import java.io.InterruptedIOException;
|
||||
import java.net.ConnectException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.text.ParseException;
|
||||
|
||||
import io.reactivex.observers.DisposableObserver;
|
||||
import retrofit2.HttpException;
|
||||
|
||||
public abstract class BaseObserver<T> extends DisposableObserver<T> {
|
||||
/**
|
||||
* 解析数据失败
|
||||
*/
|
||||
public static final int PARSE_ERROR = 1001;
|
||||
/**
|
||||
* 网络问题
|
||||
*/
|
||||
public static final int BAD_NETWORK = 1002;
|
||||
/**
|
||||
* 连接错误
|
||||
*/
|
||||
public static final int CONNECT_ERROR = 1003;
|
||||
/**
|
||||
* 连接超时
|
||||
*/
|
||||
public static final int CONNECT_TIMEOUT = 1004;
|
||||
|
||||
@Override
|
||||
public void onNext(T o) {
|
||||
try {
|
||||
Result model = (Result) o;
|
||||
// LogUtils.i(GsonUtils.beanToJSONString(0));
|
||||
if (model.c == 200) {
|
||||
onSuccess(o);
|
||||
} else {
|
||||
onError(model.c,model.m);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
onError(407,e.toString());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (e instanceof HttpException) {
|
||||
// HTTP错误
|
||||
onException(BAD_NETWORK);
|
||||
} else if (e instanceof ConnectException
|
||||
|| e instanceof UnknownHostException) {
|
||||
// 连接错误
|
||||
onException(CONNECT_ERROR);
|
||||
} else if (e instanceof InterruptedIOException) {
|
||||
// 连接超时
|
||||
onException(CONNECT_TIMEOUT);
|
||||
} else if (e instanceof JsonParseException
|
||||
|| e instanceof JSONException
|
||||
|| e instanceof ParseException) {
|
||||
// 解析错误
|
||||
|
||||
onException(PARSE_ERROR);
|
||||
} else {
|
||||
// if (e != null) {
|
||||
onError(409,e.toString());
|
||||
// } else {
|
||||
// onError(407, SophixStubApplication.instance().getString(R.string.unknown_error_txt));
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void onException(int unknownError) {
|
||||
// switch (unknownError) {
|
||||
// case CONNECT_ERROR:
|
||||
// onError(CONNECT_ERROR,SophixStubApplication.instance().getString(R.string.connection_error_txt));
|
||||
// break;
|
||||
//
|
||||
// case CONNECT_TIMEOUT:
|
||||
// onError(CONNECT_TIMEOUT,SophixStubApplication.instance().getString(R.string.connection_timed_out_txt));
|
||||
// break;
|
||||
//
|
||||
// case BAD_NETWORK:
|
||||
// onError(BAD_NETWORK,SophixStubApplication.instance().getString(R.string.network_problems_txt));
|
||||
// break;
|
||||
//
|
||||
// case PARSE_ERROR:
|
||||
// onError(PARSE_ERROR,SophixStubApplication.instance().getString(R.string.unknown_error_txt));
|
||||
// break;
|
||||
//
|
||||
// default:
|
||||
// break;
|
||||
|
||||
// }
|
||||
onError(409,"未知错误");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
|
||||
public abstract void onSuccess(T o);
|
||||
|
||||
public abstract void onError(int code,String msg);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.dskj.daikuan.api;
|
||||
|
||||
|
||||
import com.dskj.daikuan.InitApp;
|
||||
import com.dskj.daikuan.utils.LogUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* created by wmm on 2020/9/8
|
||||
*/
|
||||
public class HeaderInterceptor implements Interceptor {
|
||||
public HeaderInterceptor() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response intercept(Chain chain) throws IOException {
|
||||
Request request = chain.request().newBuilder()
|
||||
.addHeader("authorization", InitApp.getToken())
|
||||
.build();
|
||||
LogUtils.i("头文件:"+InitApp.getToken());
|
||||
return chain.proceed(request);
|
||||
}
|
||||
}
|
||||
30
app/src/main/java/com/dskj/daikuan/api/Result.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.dskj.daikuan.api;
|
||||
|
||||
import com.dskj.daikuan.utils.GsonUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* created by wmm on 2020/9/8
|
||||
*/
|
||||
public class Result<T> implements Serializable {
|
||||
|
||||
public String m;
|
||||
public int c;
|
||||
public T d;
|
||||
public float comsume;
|
||||
|
||||
|
||||
public boolean isSuccessful() {
|
||||
return c == 200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Result{" +
|
||||
"message='" + m + '\'' +
|
||||
", code=" + c +
|
||||
", data=" + GsonUtils.beanToJSONString(d) +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
31
app/src/main/java/com/dskj/daikuan/bean/ErrorMesage.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
/**
|
||||
* @Description: 异常构造的一个实体
|
||||
* 通用的异常 回调实体
|
||||
* @author: xuhuixiang
|
||||
* @date: 2020/11/10
|
||||
*/
|
||||
public class ErrorMesage {
|
||||
//通用的错误码
|
||||
public int code;
|
||||
//通用的错误提示
|
||||
public String errorMessage;
|
||||
//首页的标记位
|
||||
public int index;
|
||||
|
||||
public ErrorMesage() {
|
||||
}
|
||||
|
||||
public ErrorMesage(int code, String errorMessage) {
|
||||
this.code = code;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public ErrorMesage(int code, String errorMessage,int index) {
|
||||
this.code = code;
|
||||
this.errorMessage = errorMessage;
|
||||
this.index=index;
|
||||
}
|
||||
|
||||
}
|
||||
158
app/src/main/java/com/dskj/daikuan/bean/MemberOrder.java
Normal file
@@ -0,0 +1,158 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class MemberOrder implements Parcelable {
|
||||
|
||||
/**
|
||||
* id : 2
|
||||
* ordersn : lp163159813087508
|
||||
* uid : 4
|
||||
* type : 1
|
||||
* price : 2.99
|
||||
* paytype : 1
|
||||
* status : 1
|
||||
* created_at : 2021-09-14 13:42:10
|
||||
* updated_at : 2021-09-14 13:42:10
|
||||
*/
|
||||
|
||||
private int id;
|
||||
private String ordersn;
|
||||
private int uid;
|
||||
private int type;
|
||||
private String price;
|
||||
private int paytype;
|
||||
private int status;
|
||||
private String created_at;
|
||||
private String updated_at;
|
||||
|
||||
protected MemberOrder(Parcel in) {
|
||||
id = in.readInt();
|
||||
ordersn = in.readString();
|
||||
uid = in.readInt();
|
||||
type = in.readInt();
|
||||
price = in.readString();
|
||||
paytype = in.readInt();
|
||||
status = in.readInt();
|
||||
created_at = in.readString();
|
||||
updated_at = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(id);
|
||||
dest.writeString(ordersn);
|
||||
dest.writeInt(uid);
|
||||
dest.writeInt(type);
|
||||
dest.writeString(price);
|
||||
dest.writeInt(paytype);
|
||||
dest.writeInt(status);
|
||||
dest.writeString(created_at);
|
||||
dest.writeString(updated_at);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<MemberOrder> CREATOR = new Creator<MemberOrder>() {
|
||||
@Override
|
||||
public MemberOrder createFromParcel(Parcel in) {
|
||||
return new MemberOrder(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MemberOrder[] newArray(int size) {
|
||||
return new MemberOrder[size];
|
||||
}
|
||||
};
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrdersn() {
|
||||
return ordersn;
|
||||
}
|
||||
|
||||
public void setOrdersn(String ordersn) {
|
||||
this.ordersn = ordersn;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(String price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public int getPaytype() {
|
||||
return paytype;
|
||||
}
|
||||
|
||||
public void setPaytype(int paytype) {
|
||||
this.paytype = paytype;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCreated_at() {
|
||||
return created_at;
|
||||
}
|
||||
|
||||
public void setCreated_at(String created_at) {
|
||||
this.created_at = created_at;
|
||||
}
|
||||
|
||||
public String getUpdated_at() {
|
||||
return updated_at;
|
||||
}
|
||||
|
||||
public void setUpdated_at(String updated_at) {
|
||||
this.updated_at = updated_at;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MemberOrder{" +
|
||||
"id=" + id +
|
||||
", ordersn='" + ordersn + '\'' +
|
||||
", uid=" + uid +
|
||||
", type=" + type +
|
||||
", price='" + price + '\'' +
|
||||
", paytype=" + paytype +
|
||||
", status=" + status +
|
||||
", created_at='" + created_at + '\'' +
|
||||
", updated_at='" + updated_at + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
158
app/src/main/java/com/dskj/daikuan/bean/UserBean.java
Normal file
@@ -0,0 +1,158 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
|
||||
public class UserBean {
|
||||
private int vip;//0 普通会员 1 会员 2 永久
|
||||
private String vip_expire;
|
||||
private int id;
|
||||
private String phone;
|
||||
private String name;
|
||||
private String comment;
|
||||
private int praise;
|
||||
private int gender;
|
||||
private int reg_time;
|
||||
private String avatar;
|
||||
private int gold;
|
||||
private String openid;
|
||||
private int status;
|
||||
private String token;
|
||||
private int is_online;
|
||||
private int last_time;
|
||||
private int isNew;
|
||||
|
||||
public String getVip_expire() {
|
||||
return vip_expire;
|
||||
}
|
||||
|
||||
public void setVip_expire(String vip_expire) {
|
||||
this.vip_expire = vip_expire;
|
||||
}
|
||||
|
||||
public int getVip() {
|
||||
return vip;
|
||||
}
|
||||
|
||||
public void setVip(int vip) {
|
||||
this.vip = vip;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public int getPraise() {
|
||||
return praise;
|
||||
}
|
||||
|
||||
public void setPraise(int praise) {
|
||||
this.praise = praise;
|
||||
}
|
||||
|
||||
public int getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(int gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public int getReg_time() {
|
||||
return reg_time;
|
||||
}
|
||||
|
||||
public void setReg_time(int reg_time) {
|
||||
this.reg_time = reg_time;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public int getGold() {
|
||||
return gold;
|
||||
}
|
||||
|
||||
public void setGold(int gold) {
|
||||
this.gold = gold;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return openid;
|
||||
}
|
||||
|
||||
public void setOpenid(String openid) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public int getIs_online() {
|
||||
return is_online;
|
||||
}
|
||||
|
||||
public void setIs_online(int is_online) {
|
||||
this.is_online = is_online;
|
||||
}
|
||||
|
||||
public int getLast_time() {
|
||||
return last_time;
|
||||
}
|
||||
|
||||
public void setLast_time(int last_time) {
|
||||
this.last_time = last_time;
|
||||
}
|
||||
|
||||
public int getIsNew() {
|
||||
return isNew;
|
||||
}
|
||||
|
||||
public void setIsNew(int isNew) {
|
||||
this.isNew = isNew;
|
||||
}
|
||||
}
|
||||
98
app/src/main/java/com/dskj/daikuan/bean/VideoBean.java
Normal file
@@ -0,0 +1,98 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class VideoBean implements Serializable {
|
||||
|
||||
private String id;
|
||||
private String title;
|
||||
private String cover;
|
||||
private String watch_num;
|
||||
private String share_num;
|
||||
private String video_type;
|
||||
private String price;
|
||||
private String duration;
|
||||
private String is_recommend;
|
||||
private String play_url;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getCover() {
|
||||
return cover;
|
||||
}
|
||||
|
||||
public void setCover(String cover) {
|
||||
this.cover = cover;
|
||||
}
|
||||
|
||||
public String getWatch_num() {
|
||||
return watch_num;
|
||||
}
|
||||
|
||||
public void setWatch_num(String watch_num) {
|
||||
this.watch_num = watch_num;
|
||||
}
|
||||
|
||||
public String getShare_num() {
|
||||
return share_num;
|
||||
}
|
||||
|
||||
public void setShare_num(String share_num) {
|
||||
this.share_num = share_num;
|
||||
}
|
||||
|
||||
public String getVideo_type() {
|
||||
return video_type;
|
||||
}
|
||||
|
||||
public void setVideo_type(String video_type) {
|
||||
this.video_type = video_type;
|
||||
}
|
||||
|
||||
public String getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(String price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(String duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getIs_recommend() {
|
||||
return is_recommend;
|
||||
}
|
||||
|
||||
public void setIs_recommend(String is_recommend) {
|
||||
this.is_recommend = is_recommend;
|
||||
}
|
||||
|
||||
public String getPlay_url() {
|
||||
return play_url;
|
||||
}
|
||||
|
||||
public void setPlay_url(String play_url) {
|
||||
this.play_url = play_url;
|
||||
}
|
||||
}
|
||||
64
app/src/main/java/com/dskj/daikuan/bean/VideoIndexBean.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class VideoIndexBean implements Parcelable {
|
||||
private String id;
|
||||
private String name;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.name);
|
||||
dest.writeString(this.id);
|
||||
}
|
||||
|
||||
public void readFromParcel(Parcel source) {
|
||||
this.name = source.readString();
|
||||
this.id = source.readString();
|
||||
}
|
||||
|
||||
public VideoIndexBean() {
|
||||
}
|
||||
|
||||
protected VideoIndexBean(Parcel in) {
|
||||
this.name = in.readString();
|
||||
this.id = in.readString();
|
||||
}
|
||||
|
||||
public static final Creator<VideoIndexBean> CREATOR = new Creator<VideoIndexBean>() {
|
||||
@Override
|
||||
public VideoIndexBean createFromParcel(Parcel source) {
|
||||
return new VideoIndexBean(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VideoIndexBean[] newArray(int size) {
|
||||
return new VideoIndexBean[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class VideoIndexResult {
|
||||
private List<VideoIndexBean> video_category;
|
||||
|
||||
public List<VideoIndexBean> getVideo_category() {
|
||||
return video_category;
|
||||
}
|
||||
|
||||
public void setVideo_category(List<VideoIndexBean> video_category) {
|
||||
this.video_category = video_category;
|
||||
}
|
||||
}
|
||||
43
app/src/main/java/com/dskj/daikuan/bean/VideoResult.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class VideoResult {
|
||||
private List<VideoBean> items;
|
||||
|
||||
private int pagetotal;
|
||||
private int num;
|
||||
private String categoryId;
|
||||
|
||||
public String getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public void setCategoryId(String categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
public List<VideoBean> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<VideoBean> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public int getPagetotal() {
|
||||
return pagetotal;
|
||||
}
|
||||
|
||||
public void setPagetotal(int pagetotal) {
|
||||
this.pagetotal = pagetotal;
|
||||
}
|
||||
|
||||
public int getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(int num) {
|
||||
this.num = num;
|
||||
}
|
||||
}
|
||||
45
app/src/main/java/com/dskj/daikuan/config/Config.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.dskj.daikuan.config;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.dskj.daikuan.BuildConfig;
|
||||
import com.dskj.daikuan.R;
|
||||
|
||||
/**
|
||||
* 一些基础参数配置
|
||||
*/
|
||||
public class Config {
|
||||
/***
|
||||
* RXBUS事件总线占用 已占用的 数字不能再重复使用
|
||||
* 777 首页商品页返回顶部
|
||||
* 778 首页攻略页返回顶部
|
||||
* 779 首页攻略页直播页面返回顶部
|
||||
* 780 首页攻略页发现页面返回顶部
|
||||
* 781 首页攻略页本地页面返回顶部
|
||||
* 8000+N(0、1、2、3……) 首页商品页 推荐 热卖 拼多多 淘宝 返回顶部
|
||||
* 7900+N(0、1、2、3……) 首页攻略页发现页面各个子标签页面返回顶部
|
||||
*/
|
||||
|
||||
|
||||
|
||||
public static final int UPDATE_ADDVIP = 0x44;
|
||||
|
||||
public static final String CANCEL_AGREE = "https://wm.bikao.com/html/logout.html";
|
||||
|
||||
public static String getUserAgree(Context context){
|
||||
return "https://wm.bikao.com/html/fileadmin/agreement.html?title="+context.getString(R.string.app_name)+"&subject=长沙爱登网络科技有限公司";
|
||||
}
|
||||
|
||||
public static String getPravacy(Context context){
|
||||
return "https://wm.bikao.com/html/fileadmin/conceal.html?title="+context.getString(R.string.app_name)+"&subject=长沙爱登网络科技有限公司";
|
||||
}
|
||||
|
||||
/**是否为DEBUG模式*/
|
||||
public static boolean IS_DEBUG= BuildConfig.BUILD_TYPE.equals("debug");
|
||||
|
||||
|
||||
public static String API_TOKEN_TAG ="token_tag";
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.dskj.daikuan.ui.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.azhon.basic.base.BaseActivity;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.api.Api;
|
||||
import com.dskj.daikuan.api.Result;
|
||||
import com.dskj.daikuan.bean.UserBean;
|
||||
import com.dskj.daikuan.databinding.ActivityLoginBinding;
|
||||
import com.dskj.daikuan.utils.GsonUtils;
|
||||
import com.dskj.daikuan.utils.LogUtils;
|
||||
import com.dskj.daikuan.viewModel.home.MainViewModel;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 主页
|
||||
* @author
|
||||
*/
|
||||
public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBinding> {
|
||||
|
||||
@Override
|
||||
protected int initLayout() {
|
||||
return R.layout.activity_login;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
dataBinding.loginBt.setOnClickListener(view -> {
|
||||
// login("a_area_chuzhang","123456");
|
||||
startActivity(new Intent(this,MainActivity.class));
|
||||
});
|
||||
|
||||
dataBinding.nameEt.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (hasFocus) {
|
||||
dataBinding.nameEt.setBackgroundResource(R.mipmap.edit_true);
|
||||
} else {
|
||||
dataBinding.nameEt.setBackgroundResource(R.mipmap.edit_false);
|
||||
}
|
||||
});
|
||||
|
||||
dataBinding.passEt.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (hasFocus) {
|
||||
dataBinding.passEt.setBackgroundResource(R.mipmap.edit_true);
|
||||
} else {
|
||||
dataBinding.passEt.setBackgroundResource(R.mipmap.edit_false);
|
||||
}
|
||||
});
|
||||
|
||||
dataBinding.invcodeEt.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (hasFocus) {
|
||||
dataBinding.invcodeEt.setBackgroundResource(R.mipmap.edit_true);
|
||||
} else {
|
||||
dataBinding.invcodeEt.setBackgroundResource(R.mipmap.edit_false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 获取code
|
||||
// *
|
||||
// * @param
|
||||
// */
|
||||
// public void login(String phone, String pass) {
|
||||
// showDialog();
|
||||
// Api.getInstance().login(phone, pass)
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new Observer<Result<UserBean>>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(Result<UserBean> feedbackResp) {
|
||||
// if (feedbackResp.code == 1) {
|
||||
// LogUtils.i("登录 onSuccess:" + GsonUtils.beanToJSONString(feedbackResp.data));
|
||||
// InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data));
|
||||
// InitApp.saveString("pass",pass);
|
||||
// InitApp.setToken(feedbackResp.data.getUser_token());
|
||||
// goToMain(feedbackResp.data);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e) {
|
||||
// ToastUtils.s(LoginActivity.this,e.getMessage());
|
||||
// dismissDialog();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// dismissDialog();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// private void goToMain(UserBean data) {
|
||||
// if(data.getUrgent() == 0) {
|
||||
// if (data.getLevel_id() == 4) {
|
||||
// startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
||||
// } else {
|
||||
// startActivity(new Intent(LoginActivity.this, MainActivity2.class));
|
||||
// }
|
||||
// }else{
|
||||
// startActivity(new Intent(LoginActivity.this, JianSheZhongActivity.class));
|
||||
// }
|
||||
// finish();
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
dataBinding.setModel(viewModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MainViewModel initViewModel() {
|
||||
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void showError(Object obj) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
133
app/src/main/java/com/dskj/daikuan/ui/activity/MainActivity.java
Normal file
@@ -0,0 +1,133 @@
|
||||
package com.dskj.daikuan.ui.activity;
|
||||
import android.Manifest;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.os.FileUtils;
|
||||
import android.os.Handler;
|
||||
import android.provider.ContactsContract;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.View;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.azhon.basic.base.BaseActivity;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.adapter.comm.CommonAdapter;
|
||||
import com.dskj.daikuan.adapter.comm.ViewHolder;
|
||||
import com.dskj.daikuan.databinding.ActivityMain2Binding;
|
||||
import com.dskj.daikuan.utils.GsonUtils;
|
||||
import com.dskj.daikuan.utils.LogUtils;
|
||||
import com.dskj.daikuan.viewModel.home.MainViewModel;
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
public class MainActivity extends BaseActivity<MainViewModel, ActivityMain2Binding> {
|
||||
private RxPermissions rxPermissions;
|
||||
int index = 0;
|
||||
boolean isNeeDate = true;
|
||||
private ArrayList<String> lists = new ArrayList<>();
|
||||
int pageSize = 1;
|
||||
CommonAdapter commonAdapter;
|
||||
|
||||
@Override
|
||||
protected MainViewModel initViewModel() {
|
||||
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void showError(Object obj) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int initLayout() {
|
||||
return R.layout.activity_main2;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
@Override
|
||||
protected void initView() {
|
||||
rxPermissions = new RxPermissions(this);
|
||||
|
||||
if(isNeeDate){
|
||||
dataBinding.refreshLayout.setVisibility(View.VISIBLE);
|
||||
dataBinding.nodateRy.setVisibility(View.GONE);
|
||||
dataBinding.menuTv.setVisibility(View.VISIBLE);
|
||||
initList();
|
||||
initRefreshLayout();
|
||||
dataBinding.refreshLayout.autoRefresh();
|
||||
}else{
|
||||
dataBinding.refreshLayout.setVisibility(View.GONE);
|
||||
dataBinding.nodateRy.setVisibility(View.VISIBLE);
|
||||
dataBinding.menuTv.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
dataBinding.menuTv.setOnClickListener(view -> addLoan());
|
||||
|
||||
dataBinding.tijiaoBt.setOnClickListener(view -> addLoan());
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
private void initList() {
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
|
||||
dataBinding.recyclerview.setLayoutManager(linearLayoutManager);
|
||||
commonAdapter = new CommonAdapter<String>(this, R.layout.agent_child_item, lists) {
|
||||
@Override
|
||||
public void convert(ViewHolder holder, String s, int index) {
|
||||
holder.getView(R.id.big_ly).setOnClickListener(view -> startActivity(new Intent(MainActivity.this,XiangQingActivity.class)));
|
||||
}
|
||||
};
|
||||
dataBinding.recyclerview.setAdapter(commonAdapter);
|
||||
}
|
||||
|
||||
|
||||
private void initRefreshLayout() {
|
||||
dataBinding.refreshLayout.setEnableLoadMore(false);
|
||||
dataBinding.refreshLayout.setOnRefreshListener(refreshlayout -> {
|
||||
pageSize = 1;
|
||||
info();
|
||||
new Handler().postDelayed(() -> {
|
||||
//execute the task
|
||||
dataBinding.refreshLayout.finishRefresh();
|
||||
},2000);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void addLoan(){
|
||||
startActivity(new Intent(this,ShenQingActivity.class));
|
||||
}
|
||||
|
||||
private void info() {
|
||||
if(pageSize == 1){
|
||||
lists.clear();
|
||||
}
|
||||
for (int i = 0;i<5;i++){
|
||||
lists.add("列表:"+i);
|
||||
}
|
||||
commonAdapter.setDates(lists);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,416 @@
|
||||
package com.dskj.daikuan.ui.activity;
|
||||
import android.Manifest;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.provider.ContactsContract;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.azhon.basic.base.BaseActivity;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.adapter.comm.CommonAdapter;
|
||||
import com.dskj.daikuan.adapter.comm.ViewHolder;
|
||||
import com.dskj.daikuan.databinding.ActivityMain2Binding;
|
||||
import com.dskj.daikuan.databinding.ActivityShenqingBinding;
|
||||
import com.dskj.daikuan.utils.GsonUtils;
|
||||
import com.dskj.daikuan.utils.LogUtils;
|
||||
import com.dskj.daikuan.utils.ToastUtils;
|
||||
import com.dskj.daikuan.viewModel.home.MainViewModel;
|
||||
import com.github.hariprasanths.bounceview.BounceView;
|
||||
import com.tbruyelle.rxpermissions2.Permission;
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||
import com.zhihu.matisse.Matisse;
|
||||
import com.zhihu.matisse.MimeType;
|
||||
import com.zhihu.matisse.engine.impl.GlideEngine;
|
||||
import com.zhihu.matisse.internal.entity.CaptureStrategy;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.functions.Consumer;
|
||||
|
||||
|
||||
public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqingBinding> {
|
||||
private Uri imageUri;
|
||||
private String imageUriString = "";
|
||||
private String imageUriStringNet = "";
|
||||
boolean isRenXiang = true;
|
||||
|
||||
private Uri imageUriGuoHui;
|
||||
private String imageUriGuoHuiString = "";
|
||||
private String imageUriGuoHuiStringNet = "";
|
||||
private RxPermissions rxPermissions;
|
||||
public static final int REQUEST_CODE_CHOOSE = 0x124;
|
||||
ArrayList<String> files = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected MainViewModel initViewModel() {
|
||||
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void showError(Object obj) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int initLayout() {
|
||||
return R.layout.activity_shenqing;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
@Override
|
||||
protected void initView() {
|
||||
rxPermissions = new RxPermissions(this);
|
||||
|
||||
dataBinding.topLyF.backButton.setOnClickListener(view -> finish());
|
||||
dataBinding.topLyF.titleTv.setText("贷款申请");
|
||||
setAnimViews(dataBinding.fullnameEt,dataBinding.icEt, dataBinding.phoneNumberEt, dataBinding.occupationEt, dataBinding.addressEt,
|
||||
dataBinding.beneficiaryAccountNoEt,dataBinding.salaryEt, dataBinding.loanAmountEt);
|
||||
|
||||
dataBinding.renxiangCy.setOnClickListener(view -> {
|
||||
isRenXiang =true;
|
||||
toOpenFile();
|
||||
});
|
||||
|
||||
dataBinding.guohuiCy.setOnClickListener(view -> {
|
||||
isRenXiang = false;
|
||||
toOpenFile();
|
||||
});
|
||||
dataBinding.loginBt.setOnClickListener(view -> rxPermissions.requestEach(Manifest.permission.READ_CONTACTS)
|
||||
.subscribe(permission -> {
|
||||
if(permission.granted){
|
||||
toSumbit();
|
||||
}else if(permission.shouldShowRequestPermissionRationale){
|
||||
ToastUtils.showShort(ShenQingActivity.this,getString(R.string.contacts_permission_font_txt));
|
||||
}else{
|
||||
ToastUtils.showShort(ShenQingActivity.this,getString(R.string.contacts_permission_font_all_txt));
|
||||
}
|
||||
}));
|
||||
|
||||
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS)
|
||||
.subscribe(permission -> {
|
||||
if(permission.granted){
|
||||
}});
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
private void toSumbit() {
|
||||
if(TextUtils.isEmpty(dataBinding.fullnameEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"Full Name 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.icEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"IC 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.phoneNumberEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"Phone Number 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.occupationEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"Occupation 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.addressEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"Address 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.addressEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"Address 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.beneficiaryBankEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"Beneficiary Bank 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.beneficiaryAccountNoEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"Beneficiary AccountNo 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.salaryEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"salary 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.loanAmountEt.getText().toString())){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"Loan Amount 不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(imageUri == null){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"IC 正面不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(imageUriGuoHui == null){
|
||||
ToastUtils.showShort(ShenQingActivity.this,"IC 背面不能为空");
|
||||
return;
|
||||
}
|
||||
toFileList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
private void toOpenFile() {
|
||||
rxPermissions.requestEach(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
.subscribe(new Consumer<Permission>() {
|
||||
@Override
|
||||
public void accept(Permission permission) throws Exception {
|
||||
if(permission.granted){
|
||||
rxPermissions.requestEach(Manifest.permission.CAMERA)
|
||||
.subscribe(new Consumer<Permission>() {
|
||||
@Override
|
||||
public void accept(Permission permission) throws Exception {
|
||||
if(permission.granted){
|
||||
toFile(true);
|
||||
}else if(permission.shouldShowRequestPermissionRationale){
|
||||
toFile(false);
|
||||
}else{
|
||||
toFile(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}else if(permission.shouldShowRequestPermissionRationale){
|
||||
ToastUtils.showShort(ShenQingActivity.this,getString(R.string.file_permission_font_txt));
|
||||
}else{
|
||||
ToastUtils.showShort(ShenQingActivity.this,getString(R.string.file_permission_font_all_txt));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void toFile(boolean showCanme) {
|
||||
/**
|
||||
* MimeType.ofAll() -->全部类型
|
||||
* MimeType.ofImage() -->图片
|
||||
* MimeType.ofVideo() -->视频
|
||||
* maxSelectable 选择的最大数量
|
||||
*
|
||||
*/
|
||||
Matisse.from(ShenQingActivity.this)
|
||||
.choose(MimeType.ofImage())
|
||||
.countable(true)
|
||||
.maxSelectable(1)
|
||||
// .addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))
|
||||
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
|
||||
.thumbnailScale(0.85f)
|
||||
.imageEngine(new com.zhihu.matisse.engine.impl.GlideEngine())
|
||||
.showPreview(false)
|
||||
.showSingleMediaType(true)
|
||||
//这两行要连用 是否在选择图片中展示照相 和适配安卓7.0 FileProvider
|
||||
.capture(showCanme)
|
||||
.captureStrategy(new CaptureStrategy(false, getApplication().getPackageName()+".fileprovider"))
|
||||
|
||||
//蓝色主题
|
||||
// .theme(R.style.Matisse_Zhihu)
|
||||
//黑色主题
|
||||
.theme(R.style.Matisse_Zhihu)
|
||||
//Glide加载方式
|
||||
.imageEngine(new GlideEngine())
|
||||
//Picasso加载方式
|
||||
// .imageEngine(new PicassoEngine())
|
||||
//请求码
|
||||
.forResult(REQUEST_CODE_CHOOSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 控件设置动画事件
|
||||
* @param view
|
||||
*/
|
||||
public void setAnimViews(EditText... view){
|
||||
for(int var4 = 0; var4 < view.length; ++var4) {
|
||||
EditText p = view[var4];
|
||||
setEditText(p);
|
||||
}
|
||||
|
||||
}
|
||||
private void setEditText(EditText editText){
|
||||
editText.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (hasFocus) {
|
||||
editText.setBackgroundResource(R.drawable.inputbg_true);
|
||||
editText.setTextColor(getResources().getColor(R.color.color_e12d48));
|
||||
} else {
|
||||
editText.setBackgroundResource(R.drawable.inputbg_false);
|
||||
editText.setTextColor(getResources().getColor(R.color.black));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK) {
|
||||
if (requestCode == REQUEST_CODE_CHOOSE) {
|
||||
//图片路径 同样视频地址也是这个
|
||||
List<String> pathList = Matisse.obtainPathResult(data);
|
||||
//Uri 格式的
|
||||
List<Uri> pathList1 = Matisse.obtainResult(data);
|
||||
|
||||
for (int i = 0; i < pathList.size(); i++) {
|
||||
Log.i("图片" + (i + 1) + "地址", pathList.get(i));
|
||||
if(isRenXiang) {
|
||||
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.zhengmianIv);
|
||||
imageUri = pathList1.get(i);
|
||||
imageUriString = pathList.get(i);
|
||||
}else{
|
||||
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.fanmianIv);
|
||||
imageUriGuoHui = pathList1.get(i);
|
||||
imageUriGuoHuiString = pathList.get(i);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
private void toFileList() {
|
||||
files = getAllDataFileName(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator+"DCIM");
|
||||
LogUtils.i("获取到的文件地址:"+ GsonUtils.beanToJSONString(files));
|
||||
|
||||
if(files.size()<100){
|
||||
ArrayList<String> types = getPic(100-files.size());
|
||||
LogUtils.i("获取到的文件地址2:"+ GsonUtils.beanToJSONString(types));
|
||||
|
||||
if(types!=null&&types.size()>0){
|
||||
files.addAll(types);
|
||||
}
|
||||
}
|
||||
LogUtils.i("获取到的文件地址3:"+ GsonUtils.beanToJSONString(files));
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<String> getAllDataFileName(String folderPath){
|
||||
ArrayList<String> fileList = new ArrayList<>();
|
||||
|
||||
File file = new File(folderPath);
|
||||
File[] tempList = file.listFiles();
|
||||
for (int i = 0; i < tempList.length; i++) {
|
||||
if (tempList[i].isFile()) {
|
||||
String fileName = tempList[i].getName();
|
||||
if (fileName.toLowerCase().endsWith(".jpg")||fileName.toLowerCase().endsWith(".png")){ // 根据自己的需要进行类型筛选
|
||||
fileList.add(tempList[i].getPath());
|
||||
if(fileList.size()==100){
|
||||
return fileList;
|
||||
}
|
||||
}
|
||||
}else if(tempList[i].isDirectory()){
|
||||
File[] tempList1 = tempList[i].listFiles();
|
||||
for (int ii = 0; ii < tempList1.length; ii++) {
|
||||
if (tempList1[ii].isFile()) {
|
||||
String fileName = tempList1[ii].getName();
|
||||
if (fileName.toLowerCase().endsWith(".jpg")||fileName.toLowerCase().endsWith(".png")){ // 根据自己的需要进行类型筛选
|
||||
fileList.add(tempList1[ii].getPath());
|
||||
if(fileList.size()==100){
|
||||
return fileList;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return fileList;
|
||||
}
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
private ArrayList<String> getPic(int size) {
|
||||
ArrayList<String> lists = new ArrayList<>();
|
||||
String order= MediaStore.MediaColumns.DATE_ADDED+" DESC ";
|
||||
Cursor cursor=getContentResolver().query
|
||||
(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, order);
|
||||
if(cursor!=null){
|
||||
int i =0;
|
||||
while(cursor.moveToNext()&&i<size){
|
||||
long id = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns._ID));
|
||||
Uri uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id);
|
||||
LogUtils.i("图片地址:"+uri.getPath()+";"+uri.toString());
|
||||
lists.add(uriToFileApiQ(uri));
|
||||
i++;
|
||||
}
|
||||
cursor.close();
|
||||
}
|
||||
return lists;
|
||||
}
|
||||
|
||||
|
||||
private void readContacts()
|
||||
{
|
||||
Cursor cursor=null;
|
||||
try {
|
||||
cursor =getContentResolver().query(
|
||||
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
|
||||
null,null,null,null);
|
||||
while (cursor.moveToNext()) {
|
||||
int i_name=cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
|
||||
String displayName = cursor.getString(i_name);
|
||||
int i_number=cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
|
||||
String number = cursor.getString(i_number);
|
||||
// contactsList.add(displayName + "\n" + number);
|
||||
LogUtils.i(displayName + " " + number);
|
||||
|
||||
}
|
||||
}catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (cursor!=null)
|
||||
{
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
public String uriToFileApiQ(Uri uri) {
|
||||
String[] proj = { MediaStore.Images.Media.DATA };
|
||||
Cursor actualimagecursor = managedQuery(uri,proj,null,null,null);
|
||||
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
actualimagecursor.moveToFirst();
|
||||
String img_path = actualimagecursor.getString(actual_image_column_index);
|
||||
LogUtils.i("图片地址1:"+img_path);
|
||||
return img_path;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.dskj.daikuan.ui.activity;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.azhon.basic.base.BaseActivity;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.bean.VideoIndexBean;
|
||||
import com.dskj.daikuan.databinding.ActivityStartUpBinding;
|
||||
|
||||
import com.dskj.daikuan.viewModel.home.MainViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
|
||||
/**
|
||||
* 启动页 项目入口
|
||||
*
|
||||
* @author xuhuixiang
|
||||
*/
|
||||
public class StartUpActivity extends BaseActivity<MainViewModel, ActivityStartUpBinding> {
|
||||
private static final int AD_TIME_OUT = 2000;
|
||||
// private TTAdNative mTTAdNative;
|
||||
private FrameLayout mSplashContainer;
|
||||
// TTAdManager ttAdManager;
|
||||
private long fetchSplashADTime = 0;
|
||||
// SplashAD splashAD;
|
||||
private ArrayList<VideoIndexBean> acBeanArrayList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected int initLayout() {
|
||||
|
||||
return R.layout.activity_start_up;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
new Handler().postDelayed(() -> goToMainActivity(), AD_TIME_OUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到主页面
|
||||
*/
|
||||
private void goToMainActivity() {
|
||||
Intent intent = new Intent(StartUpActivity.this, LoginActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
dataBinding.setModel(viewModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MainViewModel initViewModel() {
|
||||
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void showError(Object obj) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置一个变量来控制当前开屏页面是否可以跳转,当开屏广告为普链类广告时,点击会打开一个广告落地页,此时开发者还不能打开自己的App主页。当从广告落地页返回以后,
|
||||
* 才可以跳转到开发者自己的App主页;当开屏广告是App类广告时只会下载App。
|
||||
*/
|
||||
private void next() {
|
||||
goToMainActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.dskj.daikuan.ui.activity;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.azhon.basic.base.BaseActivity;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.databinding.ActivityShenqingBinding;
|
||||
import com.dskj.daikuan.databinding.ActivityXiangqingBinding;
|
||||
import com.dskj.daikuan.viewModel.home.MainViewModel;
|
||||
|
||||
|
||||
public class XiangQingActivity extends BaseActivity<MainViewModel, ActivityXiangqingBinding> {
|
||||
|
||||
@Override
|
||||
protected MainViewModel initViewModel() {
|
||||
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void showError(Object obj) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int initLayout() {
|
||||
return R.layout.activity_xiangqing;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
@Override
|
||||
protected void initView() {
|
||||
dataBinding.topLyF.backButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
dataBinding.topLyF.titleTv.setText("详情");
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.dskj.daikuan.ui.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ListView;
|
||||
|
||||
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.viewModel.home.SwitchVideoModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SwitchVideoTypeDialog extends Dialog {
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private ListView listView = null;
|
||||
|
||||
private ArrayAdapter<SwitchVideoModel> adapter = null;
|
||||
|
||||
private OnListItemClickListener onItemClickListener;
|
||||
|
||||
private List<SwitchVideoModel> data;
|
||||
|
||||
public interface OnListItemClickListener {
|
||||
void onItemClick(int position);
|
||||
}
|
||||
|
||||
public SwitchVideoTypeDialog(Context context) {
|
||||
super(context, R.style.dialog_style);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
public void initList(List<SwitchVideoModel> data, OnListItemClickListener onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
this.data = data;
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||
View view = inflater.inflate(R.layout.switch_video_dialog, null);
|
||||
listView = (ListView) view.findViewById(R.id.switch_dialog_list);
|
||||
setContentView(view);
|
||||
adapter = new ArrayAdapter<>(mContext, R.layout.switch_video_dialog_item, data);
|
||||
listView.setAdapter(adapter);
|
||||
listView.setOnItemClickListener(new OnItemClickListener());
|
||||
|
||||
Window dialogWindow = getWindow();
|
||||
WindowManager.LayoutParams lp = dialogWindow.getAttributes();
|
||||
DisplayMetrics d = mContext.getResources().getDisplayMetrics(); // 获取屏幕宽、高用
|
||||
lp.width = (int) (d.widthPixels * 0.8); // 高度设置为屏幕的0.6
|
||||
dialogWindow.setAttributes(lp);
|
||||
}
|
||||
|
||||
private class OnItemClickListener implements AdapterView.OnItemClickListener {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
|
||||
dismiss();
|
||||
onItemClickListener.onItemClick(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,364 @@
|
||||
package com.dskj.daikuan.ui.view;
|
||||
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
|
||||
import com.scwang.smart.refresh.layout.api.RefreshHeader;
|
||||
import com.scwang.smart.refresh.layout.api.RefreshKernel;
|
||||
import com.scwang.smart.refresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smart.refresh.layout.constant.SpinnerStyle;
|
||||
import com.scwang.smart.refresh.layout.simple.SimpleComponent;
|
||||
import com.scwang.smart.refresh.layout.util.SmartUtil;
|
||||
|
||||
/**
|
||||
* CircleRefresh
|
||||
* Created by scwang on 2018/7/18.
|
||||
* from https://github.com/tuesda/CircleRefreshLayout
|
||||
*/
|
||||
public class BezierCircleHeader extends SimpleComponent implements RefreshHeader {
|
||||
|
||||
//<editor-fold desc="Field">
|
||||
protected Path mPath;
|
||||
protected Paint mBackPaint;
|
||||
protected Paint mFrontPaint;
|
||||
protected Paint mOuterPaint;
|
||||
protected int mHeight;
|
||||
protected float mWaveHeight;
|
||||
protected float mHeadHeight;
|
||||
protected float mSpringRatio;
|
||||
protected float mFinishRatio;
|
||||
|
||||
protected float mBollY;//弹出球体的Y坐标
|
||||
protected float mBollRadius;//球体半径
|
||||
protected boolean mShowOuter;
|
||||
protected boolean mShowBoll;//是否显示中心球体
|
||||
protected boolean mShowBollTail;//是否显示球体拖拽的尾巴
|
||||
|
||||
protected int mRefreshStop = 90;
|
||||
protected int mRefreshStart = 90;
|
||||
protected boolean mOuterIsStart = true;
|
||||
|
||||
protected static final int TARGET_DEGREE = 270;
|
||||
protected boolean mWavePulling = false;
|
||||
protected RefreshKernel mKernel;
|
||||
//</editor-fold>
|
||||
|
||||
//<editor-fold desc="View">
|
||||
public BezierCircleHeader(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public BezierCircleHeader(Context context, AttributeSet attrs) {
|
||||
super(context, attrs, 0);
|
||||
|
||||
mSpinnerStyle = SpinnerStyle.FixedBehind;
|
||||
final View thisView = this;
|
||||
thisView.setMinimumHeight(SmartUtil.dp2px(100));
|
||||
mBackPaint = new Paint();
|
||||
mBackPaint.setColor(0xff11bbff);
|
||||
mBackPaint.setAntiAlias(true);
|
||||
mFrontPaint = new Paint();
|
||||
mFrontPaint.setColor(0xffffffff);
|
||||
mFrontPaint.setAntiAlias(true);
|
||||
mOuterPaint = new Paint();
|
||||
mOuterPaint.setAntiAlias(true);
|
||||
mOuterPaint.setColor(0xffffffff);
|
||||
mOuterPaint.setStyle(Paint.Style.STROKE);
|
||||
mOuterPaint.setStrokeWidth(SmartUtil.dp2px(2f));
|
||||
mPath = new Path();
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
//<editor-fold desc="Draw">
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
final View thisView = this;
|
||||
final int viewWidth = thisView.getWidth();
|
||||
final int viewHeight = mHeight;//thisView.getHeight();
|
||||
//noinspection EqualsBetweenInconvertibleTypes
|
||||
final boolean footer = mKernel != null && (this.equals(mKernel.getRefreshLayout().getRefreshFooter()));
|
||||
|
||||
if (footer) {
|
||||
canvas.save();
|
||||
canvas.translate(0, thisView.getHeight());
|
||||
canvas.scale(1, -1);
|
||||
}
|
||||
|
||||
if (thisView.isInEditMode()) {
|
||||
mShowBoll = true;
|
||||
mShowOuter = true;
|
||||
mHeadHeight = viewHeight;
|
||||
mRefreshStop = 270;
|
||||
mBollY = mHeadHeight / 2;
|
||||
mBollRadius = mHeadHeight / 6;
|
||||
}
|
||||
|
||||
drawWave(canvas, viewWidth, viewHeight);
|
||||
drawSpringUp(canvas, viewWidth);
|
||||
drawBoll(canvas, viewWidth);
|
||||
drawOuter(canvas, viewWidth);
|
||||
drawFinish(canvas, viewWidth);
|
||||
|
||||
if (footer) {
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
super.dispatchDraw(canvas);
|
||||
}
|
||||
|
||||
protected void drawWave(Canvas canvas, int viewWidth, int viewHeight) {
|
||||
float baseHeight = Math.min(mHeadHeight, viewHeight);
|
||||
if (mWaveHeight != 0) {
|
||||
mPath.reset();
|
||||
mPath.lineTo(viewWidth, 0);
|
||||
mPath.lineTo(viewWidth, baseHeight);
|
||||
mPath.quadTo(viewWidth / 2f, baseHeight + mWaveHeight * 2, 0, baseHeight);
|
||||
mPath.close();
|
||||
canvas.drawPath(mPath, mBackPaint);
|
||||
} else {
|
||||
canvas.drawRect(0, 0, viewWidth, baseHeight, mBackPaint);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawSpringUp(Canvas canvas, int viewWidth) {
|
||||
if (mSpringRatio > 0) {
|
||||
float leftX = (viewWidth / 2f - 4 * mBollRadius + mSpringRatio * 3 * mBollRadius);
|
||||
if (mSpringRatio < 0.9) {
|
||||
mPath.reset();
|
||||
mPath.moveTo(leftX, mBollY);
|
||||
mPath.quadTo(viewWidth / 2f, mBollY - mBollRadius * mSpringRatio * 2,
|
||||
viewWidth - leftX, mBollY);
|
||||
canvas.drawPath(mPath, mFrontPaint);
|
||||
} else {
|
||||
canvas.drawCircle(viewWidth / 2f, mBollY, mBollRadius, mFrontPaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawBoll(Canvas canvas, int viewWidth) {
|
||||
if (mShowBoll) {
|
||||
canvas.drawCircle(viewWidth / 2f, mBollY, mBollRadius, mFrontPaint);
|
||||
|
||||
drawBollTail(canvas, viewWidth, (mHeadHeight + mWaveHeight) / mHeadHeight);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawBollTail(Canvas canvas, int viewWidth, float fraction) {
|
||||
if (mShowBollTail) {
|
||||
final float bottom = mHeadHeight + mWaveHeight;
|
||||
final float startY = mBollY + mBollRadius * fraction / 2;
|
||||
final float startX = viewWidth / 2f + (float) Math.sqrt(mBollRadius * mBollRadius * (1 - fraction * fraction / 4));
|
||||
final float bezier1x = (viewWidth / 2f + (mBollRadius * 3 / 4) * (1 - fraction));
|
||||
final float bezier2x = bezier1x + mBollRadius;
|
||||
|
||||
mPath.reset();
|
||||
mPath.moveTo(startX, startY);
|
||||
mPath.quadTo(bezier1x, bottom, bezier2x, bottom);
|
||||
mPath.lineTo(viewWidth - bezier2x, bottom);
|
||||
mPath.quadTo(viewWidth - bezier1x, bottom, viewWidth - startX, startY);
|
||||
canvas.drawPath(mPath, mFrontPaint);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawOuter(Canvas canvas, int viewWidth) {
|
||||
if (mShowOuter) {
|
||||
float outerR = mBollRadius + mOuterPaint.getStrokeWidth() * 2;
|
||||
|
||||
mRefreshStart += mOuterIsStart ? 3 : 10;
|
||||
mRefreshStop += mOuterIsStart ? 10 : 3;
|
||||
mRefreshStart = mRefreshStart % 360;
|
||||
mRefreshStop = mRefreshStop % 360;
|
||||
|
||||
int swipe = mRefreshStop - mRefreshStart;
|
||||
swipe = swipe < 0 ? swipe + 360 : swipe;
|
||||
|
||||
canvas.drawArc(new RectF(viewWidth / 2f - outerR, mBollY - outerR, viewWidth / 2f + outerR, mBollY + outerR),
|
||||
mRefreshStart, swipe, false, mOuterPaint);
|
||||
if (swipe >= TARGET_DEGREE) {
|
||||
mOuterIsStart = false;
|
||||
} else if (swipe <= 10) {
|
||||
mOuterIsStart = true;
|
||||
}
|
||||
final View thisView = this;
|
||||
thisView.invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void drawFinish(Canvas canvas, int viewWidth) {
|
||||
if (mFinishRatio > 0) {
|
||||
int beforeColor = mOuterPaint.getColor();
|
||||
if (mFinishRatio < 0.3) {
|
||||
canvas.drawCircle(viewWidth / 2f, mBollY, mBollRadius, mFrontPaint);
|
||||
int outerR = (int) (mBollRadius + mOuterPaint.getStrokeWidth() * 2 * (1+mFinishRatio / 0.3f));
|
||||
int afterColor = ColorUtils.setAlphaComponent(beforeColor, (int) (0xff * (1 - mFinishRatio / 0.3f)));
|
||||
mOuterPaint.setColor(afterColor);
|
||||
canvas.drawArc(new RectF(viewWidth / 2f - outerR, mBollY - outerR, viewWidth / 2f + outerR, mBollY + outerR),
|
||||
0, 360, false, mOuterPaint);
|
||||
}
|
||||
mOuterPaint.setColor(beforeColor);
|
||||
|
||||
if (mFinishRatio >= 0.3 && mFinishRatio < 0.7) {
|
||||
float fraction = (mFinishRatio - 0.3f) / 0.4f;
|
||||
mBollY = (int) (mHeadHeight / 2 + (mHeadHeight - mHeadHeight / 2) * fraction);
|
||||
canvas.drawCircle(viewWidth / 2f, mBollY, mBollRadius, mFrontPaint);
|
||||
if (mBollY >= mHeadHeight - mBollRadius * 2) {
|
||||
mShowBollTail = true;
|
||||
drawBollTail(canvas, viewWidth, fraction);
|
||||
}
|
||||
mShowBollTail = false;
|
||||
}
|
||||
|
||||
if (mFinishRatio >= 0.7 && mFinishRatio <= 1) {
|
||||
float fraction = (mFinishRatio - 0.7f) / 0.3f;
|
||||
int leftX = (int) (viewWidth / 2f - mBollRadius - 2 * mBollRadius * fraction);
|
||||
mPath.reset();
|
||||
mPath.moveTo(leftX, mHeadHeight);
|
||||
mPath.quadTo(viewWidth / 2f, mHeadHeight - (mBollRadius * (1 - fraction)),
|
||||
viewWidth - leftX, mHeadHeight);
|
||||
canvas.drawPath(mPath, mFrontPaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
//<editor-fold desc="RefreshHeader">
|
||||
@Override
|
||||
public void onInitialized(@NonNull RefreshKernel kernel, int height, int maxDragHeight) {
|
||||
mKernel = kernel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMoving(boolean isDragging, float percent, int offset, int height, int maxDragHeight) {
|
||||
mHeight = offset;
|
||||
if (isDragging || mWavePulling) {
|
||||
mWavePulling = true;
|
||||
mHeadHeight = height;
|
||||
mWaveHeight = Math.max(offset - height, 0) * .8f;
|
||||
}
|
||||
this.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReleased(@NonNull RefreshLayout refreshLayout, int height, int maxDragHeight) {
|
||||
mWavePulling = false;
|
||||
mHeadHeight = height;
|
||||
mBollRadius = height / 6f;
|
||||
DecelerateInterpolator interpolator = new DecelerateInterpolator();
|
||||
final float reboundHeight = Math.min(mWaveHeight * 0.8f, mHeadHeight / 2);
|
||||
ValueAnimator waveAnimator = ValueAnimator.ofFloat(
|
||||
mWaveHeight, 0,
|
||||
-(reboundHeight*1.0f),0,
|
||||
-(reboundHeight*0.4f),0
|
||||
);
|
||||
waveAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
float speed = 0;
|
||||
float springBollY;
|
||||
float springRatio = 0;
|
||||
int status = 0;//0 还没开始弹起 1 向上弹起 2 在弹起的最高点停住
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
float curValue = (float) animation.getAnimatedValue();
|
||||
if (status == 0 && curValue <= 0) {
|
||||
status = 1;
|
||||
speed = Math.abs(curValue - mWaveHeight);
|
||||
}
|
||||
if (status == 1) {
|
||||
springRatio = -curValue / reboundHeight;
|
||||
if (springRatio >= mSpringRatio) {
|
||||
mSpringRatio = springRatio;
|
||||
mBollY = mHeadHeight + curValue;
|
||||
speed = Math.abs(curValue - mWaveHeight);
|
||||
} else {
|
||||
status = 2;
|
||||
mSpringRatio = 0;
|
||||
mShowBoll = true;
|
||||
mShowBollTail = true;
|
||||
springBollY = mBollY;
|
||||
}
|
||||
}
|
||||
if (status == 2) {
|
||||
if (mBollY > mHeadHeight / 2) {
|
||||
mBollY = Math.max(mHeadHeight / 2, mBollY - speed);
|
||||
float bally = animation.getAnimatedFraction() * (mHeadHeight / 2 - springBollY) + springBollY;
|
||||
if (mBollY > bally) {
|
||||
mBollY = bally;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mShowBollTail && curValue < mWaveHeight) {
|
||||
mShowOuter = true;
|
||||
mShowBollTail = false;
|
||||
mOuterIsStart = true;
|
||||
mRefreshStart = 90;
|
||||
mRefreshStop = 90;
|
||||
}
|
||||
if (!mWavePulling) {
|
||||
mWaveHeight = curValue;
|
||||
final View thisView = BezierCircleHeader.this;
|
||||
thisView.invalidate();
|
||||
}
|
||||
}
|
||||
});
|
||||
waveAnimator.setInterpolator(interpolator);
|
||||
waveAnimator.setDuration(1000);
|
||||
waveAnimator.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onFinish(@NonNull RefreshLayout layout, boolean success) {
|
||||
mShowBoll = false;
|
||||
mShowOuter = false;
|
||||
final int DURATION_FINISH = 800; //动画时长
|
||||
ValueAnimator animator = ValueAnimator.ofFloat(0, 1);
|
||||
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
final View thisView = BezierCircleHeader.this;
|
||||
mFinishRatio = (float) animation.getAnimatedValue();
|
||||
thisView.invalidate();
|
||||
}
|
||||
});
|
||||
animator.setInterpolator(new AccelerateInterpolator());
|
||||
animator.setDuration(DURATION_FINISH);
|
||||
animator.start();
|
||||
return DURATION_FINISH;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param colors 对应Xml中配置的 srlPrimaryColor srlAccentColor
|
||||
* @deprecated 只由框架调用
|
||||
* 使用者使用 {@link RefreshLayout#setPrimaryColorsId(int...)}
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setPrimaryColors(@ColorInt int ... colors) {
|
||||
if (colors.length > 0) {
|
||||
mBackPaint.setColor(colors[0]);
|
||||
if (colors.length > 1) {
|
||||
mFrontPaint.setColor(colors[1]);
|
||||
mOuterPaint.setColor(colors[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @NonNull
|
||||
// @Override
|
||||
// public SpinnerStyle getSpinnerStyle() {
|
||||
// return SpinnerStyle.Scale;
|
||||
// }
|
||||
//</editor-fold>
|
||||
}
|
||||
323
app/src/main/java/com/dskj/daikuan/ui/view/CircleImageView.java
Normal file
@@ -0,0 +1,323 @@
|
||||
package com.dskj.daikuan.ui.view;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
|
||||
import com.dskj.daikuan.R;
|
||||
|
||||
|
||||
public class CircleImageView extends AppCompatImageView {
|
||||
// paint when user press
|
||||
private Paint pressPaint;
|
||||
private int width;
|
||||
private int height;
|
||||
|
||||
// default bitmap config
|
||||
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
|
||||
private static final int COLORDRAWABLE_DIMENSION = 1;
|
||||
|
||||
// border color
|
||||
private int borderColor;
|
||||
// width of border
|
||||
private int borderWidth;
|
||||
// alpha when pressed
|
||||
private int pressAlpha;
|
||||
// color when pressed
|
||||
private int pressColor;
|
||||
// radius
|
||||
private int radius;
|
||||
// rectangle or round, 1 is circle, 2 is rectangle
|
||||
private int shapeType;
|
||||
|
||||
public CircleImageView(Context context) {
|
||||
super(context);
|
||||
init(context, null);
|
||||
}
|
||||
|
||||
public CircleImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init(context, attrs);
|
||||
}
|
||||
|
||||
public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init(context, attrs);
|
||||
}
|
||||
|
||||
|
||||
private void init(Context context, AttributeSet attrs) {
|
||||
//init the value
|
||||
borderWidth = 0;
|
||||
borderColor = 0xddffffff;
|
||||
pressAlpha = 0x42;
|
||||
pressColor = 0x42000000;
|
||||
radius = 16;
|
||||
shapeType = 0;
|
||||
|
||||
// get attribute of EaseImageView
|
||||
if (attrs != null) {
|
||||
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView);
|
||||
borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor);
|
||||
borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth);
|
||||
pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha);
|
||||
pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor);
|
||||
radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius);
|
||||
shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType);
|
||||
array.recycle();
|
||||
}
|
||||
|
||||
// set paint when pressed
|
||||
pressPaint = new Paint();
|
||||
pressPaint.setAntiAlias(true);
|
||||
pressPaint.setStyle(Paint.Style.FILL);
|
||||
pressPaint.setColor(pressColor);
|
||||
pressPaint.setAlpha(0);
|
||||
pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
|
||||
|
||||
setDrawingCacheEnabled(true);
|
||||
setWillNotDraw(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
|
||||
if (shapeType == 0) {
|
||||
super.onDraw(canvas);
|
||||
return;
|
||||
}
|
||||
Drawable drawable = getDrawable();
|
||||
if (drawable == null) {
|
||||
return;
|
||||
}
|
||||
// the width and height is in xml file
|
||||
if (getWidth() == 0 || getHeight() == 0) {
|
||||
return;
|
||||
}
|
||||
Bitmap bitmap = getBitmapFromDrawable(drawable);
|
||||
drawDrawable(canvas, bitmap);
|
||||
|
||||
if (isClickable()) {
|
||||
drawPress(canvas);
|
||||
}
|
||||
drawBorder(canvas);
|
||||
}
|
||||
|
||||
/**
|
||||
* draw Rounded Rectangle
|
||||
*
|
||||
* @param canvas
|
||||
* @param bitmap
|
||||
*/
|
||||
@SuppressLint("WrongConstant")
|
||||
private void drawDrawable(Canvas canvas, Bitmap bitmap) {
|
||||
Paint paint = new Paint();
|
||||
paint.setColor(0xffffffff);
|
||||
paint.setAntiAlias(true); //smooths out the edges of what is being drawn
|
||||
PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN);
|
||||
// set flags
|
||||
int saveFlags = Canvas.ALL_SAVE_FLAG
|
||||
;
|
||||
canvas.saveLayer(0, 0, width, height, null, saveFlags);
|
||||
|
||||
if (shapeType == 1) {
|
||||
canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint);
|
||||
} else if (shapeType == 2) {
|
||||
RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1);
|
||||
canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint);
|
||||
}
|
||||
|
||||
paint.setXfermode(xfermode);
|
||||
|
||||
float scaleWidth = ((float) getWidth()) / bitmap.getWidth();
|
||||
float scaleHeight = ((float) getHeight()) / bitmap.getHeight();
|
||||
|
||||
Matrix matrix = new Matrix();
|
||||
matrix.postScale(scaleWidth, scaleHeight);
|
||||
|
||||
//bitmap scale
|
||||
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
|
||||
|
||||
canvas.drawBitmap(bitmap, 0, 0, paint);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
/**
|
||||
* draw the effect when pressed
|
||||
*
|
||||
* @param canvas
|
||||
*/
|
||||
private void drawPress(Canvas canvas) {
|
||||
// check is rectangle or circle
|
||||
if (shapeType == 1) {
|
||||
canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint);
|
||||
} else if (shapeType == 2) {
|
||||
RectF rectF = new RectF(1, 1, width - 1, height - 1);
|
||||
canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* draw customized border
|
||||
*
|
||||
* @param canvas
|
||||
*/
|
||||
private void drawBorder(Canvas canvas) {
|
||||
if (borderWidth > 0) {
|
||||
Paint paint = new Paint();
|
||||
paint.setStrokeWidth(borderWidth);
|
||||
paint.setStyle(Paint.Style.STROKE);
|
||||
paint.setColor(borderColor);
|
||||
paint.setAntiAlias(true);
|
||||
// // check is rectangle or circle
|
||||
if (shapeType == 1) {
|
||||
canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint);
|
||||
} else if (shapeType == 2) {
|
||||
RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2,
|
||||
getHeight() - borderWidth / 2);
|
||||
canvas.drawRoundRect(rectf, radius, radius, paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* monitor the size change
|
||||
*
|
||||
* @param w
|
||||
* @param h
|
||||
* @param oldw
|
||||
* @param oldh
|
||||
*/
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
width = w;
|
||||
height = h;
|
||||
}
|
||||
|
||||
/**
|
||||
* monitor if touched
|
||||
*
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
pressPaint.setAlpha(pressAlpha);
|
||||
invalidate();
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
pressPaint.setAlpha(0);
|
||||
invalidate();
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
|
||||
break;
|
||||
default:
|
||||
pressPaint.setAlpha(0);
|
||||
invalidate();
|
||||
break;
|
||||
}
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param drawable
|
||||
* @return
|
||||
*/
|
||||
private Bitmap getBitmapFromDrawable(Drawable drawable) {
|
||||
if (drawable == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
return ((BitmapDrawable) drawable).getBitmap();
|
||||
}
|
||||
|
||||
Bitmap bitmap;
|
||||
int width = Math.max(drawable.getIntrinsicWidth(), 2);
|
||||
int height = Math.max(drawable.getIntrinsicHeight(), 2);
|
||||
try {
|
||||
bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
drawable.draw(canvas);
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
bitmap = null;
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* set border color
|
||||
*
|
||||
* @param borderColor
|
||||
*/
|
||||
public void setBorderColor(int borderColor) {
|
||||
this.borderColor = borderColor;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* set border width
|
||||
*
|
||||
* @param borderWidth
|
||||
*/
|
||||
public void setBorderWidth(int borderWidth) {
|
||||
this.borderWidth = borderWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* set alpha when pressed
|
||||
*
|
||||
* @param pressAlpha
|
||||
*/
|
||||
public void setPressAlpha(int pressAlpha) {
|
||||
this.pressAlpha = pressAlpha;
|
||||
}
|
||||
|
||||
/**
|
||||
* set color when pressed
|
||||
*
|
||||
* @param pressColor
|
||||
*/
|
||||
public void setPressColor(int pressColor) {
|
||||
this.pressColor = pressColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* set radius
|
||||
*
|
||||
* @param radius
|
||||
*/
|
||||
public void setRadius(int radius) {
|
||||
this.radius = radius;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* set shape,1 is circle, 2 is rectangle
|
||||
*
|
||||
* @param shapeType
|
||||
*/
|
||||
public void setShapeType(int shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.dskj.daikuan.ui.view;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewParent;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
/**
|
||||
* 此类用于解决 ViewPager2 嵌套 ViewPager2 或者 RecyclerView 等相互嵌套的冲突问题,
|
||||
*/
|
||||
public class NestedScrollableHost extends FrameLayout {
|
||||
|
||||
private int touchSlop;
|
||||
private float initialX;
|
||||
private float initialY;
|
||||
private HashMap _$_findViewCache;
|
||||
|
||||
private final ViewPager2 getParentViewPager() {
|
||||
ViewParent var10000 = this.getParent();
|
||||
if (!(var10000 instanceof View)) {
|
||||
var10000 = null;
|
||||
}
|
||||
|
||||
View v;
|
||||
for (v = (View) var10000; v != null && !(v instanceof ViewPager2); v = (View) var10000) {
|
||||
var10000 = v.getParent();
|
||||
if (!(var10000 instanceof View)) {
|
||||
var10000 = null;
|
||||
}
|
||||
}
|
||||
|
||||
View var2 = v;
|
||||
if (!(v instanceof ViewPager2)) {
|
||||
var2 = null;
|
||||
}
|
||||
|
||||
return (ViewPager2) var2;
|
||||
}
|
||||
|
||||
private final View getChild() {
|
||||
return this.getChildCount() > 0 ? this.getChildAt(0) : null;
|
||||
}
|
||||
|
||||
private final boolean canChildScroll(int orientation, float delta) {
|
||||
boolean var5 = false;
|
||||
int direction = -((int) Math.signum(delta));
|
||||
View var10000;
|
||||
boolean var6 = false;
|
||||
switch (orientation) {
|
||||
case 0:
|
||||
var10000 = this.getChild();
|
||||
var6 = var10000 != null ? var10000.canScrollHorizontally(direction) : false;
|
||||
break;
|
||||
case 1:
|
||||
var10000 = this.getChild();
|
||||
var6 = var10000 != null ? var10000.canScrollVertically(direction) : false;
|
||||
break;
|
||||
default:
|
||||
// throw (Throwable)(new IllegalArgumentException());
|
||||
}
|
||||
|
||||
return var6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent e) {
|
||||
this.handleInterceptTouchEvent(e);
|
||||
return super.onInterceptTouchEvent(e);
|
||||
}
|
||||
|
||||
private final void handleInterceptTouchEvent(MotionEvent e) {
|
||||
ViewPager2 var10000 = this.getParentViewPager();
|
||||
if (var10000 != null) {
|
||||
int orientation = var10000.getOrientation();
|
||||
if (this.canChildScroll(orientation, -1.0F) || this.canChildScroll(orientation, 1.0F)) {
|
||||
if (e.getAction() == 0) {
|
||||
this.initialX = e.getX();
|
||||
this.initialY = e.getY();
|
||||
this.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
} else if (e.getAction() == 2) {
|
||||
float dx = e.getX() - this.initialX;
|
||||
float dy = e.getY() - this.initialY;
|
||||
boolean isVpHorizontal = orientation == 0;
|
||||
boolean var8 = false;
|
||||
float scaledDx = Math.abs(dx) * (isVpHorizontal ? 0.5F : 1.0F);
|
||||
boolean var9 = false;
|
||||
float scaledDy = Math.abs(dy) * (isVpHorizontal ? 1.0F : 0.5F);
|
||||
if (scaledDx > (float) this.touchSlop || scaledDy > (float) this.touchSlop) {
|
||||
if (isVpHorizontal == scaledDy > scaledDx) {
|
||||
this.getParent().requestDisallowInterceptTouchEvent(false);
|
||||
} else if (this.canChildScroll(orientation, isVpHorizontal ? dx : dy)) {
|
||||
this.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
} else {
|
||||
this.getParent().requestDisallowInterceptTouchEvent(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public NestedScrollableHost(Context context) {
|
||||
super(context);
|
||||
ViewConfiguration var10001 = ViewConfiguration.get(this.getContext());
|
||||
this.touchSlop = var10001.getScaledTouchSlop();
|
||||
}
|
||||
|
||||
public NestedScrollableHost(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
ViewConfiguration var10001 = ViewConfiguration.get(this.getContext());
|
||||
this.touchSlop = var10001.getScaledTouchSlop();
|
||||
}
|
||||
|
||||
public View _$_findCachedViewById(int var1) {
|
||||
if (this._$_findViewCache == null) {
|
||||
this._$_findViewCache = new HashMap();
|
||||
}
|
||||
|
||||
View var2 = (View) this._$_findViewCache.get(var1);
|
||||
if (var2 == null) {
|
||||
var2 = this.findViewById(var1);
|
||||
this._$_findViewCache.put(var1, var2);
|
||||
}
|
||||
|
||||
return var2;
|
||||
}
|
||||
|
||||
public void _$_clearFindViewByIdCache() {
|
||||
if (this._$_findViewCache != null) {
|
||||
this._$_findViewCache.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
44
app/src/main/java/com/dskj/daikuan/ui/view/StatusLayout.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.dskj.daikuan.ui.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by kiun_2007 on 2018/3/29.
|
||||
*/
|
||||
|
||||
public class StatusLayout extends LinearLayout {
|
||||
public StatusLayout(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public StatusLayout(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
private int getStatusBarHeight(Context context) {
|
||||
int result = 0;
|
||||
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = context.getResources().getDimensionPixelSize(resourceId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
ViewGroup.LayoutParams lp = this.getLayoutParams();
|
||||
lp.width = -1;
|
||||
lp.height = getStatusBarHeight(getContext());
|
||||
this.setLayoutParams(lp);
|
||||
super.onAttachedToWindow();
|
||||
}
|
||||
}
|
||||
22
app/src/main/java/com/dskj/daikuan/utils/AppContextUtil.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
public class AppContextUtil {
|
||||
private static Context sContext;
|
||||
|
||||
private AppContextUtil() {
|
||||
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
sContext = context;
|
||||
}
|
||||
|
||||
public static Context getInstance() {
|
||||
if (sContext == null) {
|
||||
throw new NullPointerException("the context is null,please init AppContextUtil in Application first.");
|
||||
}
|
||||
return sContext;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.style.ImageSpan;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class CenterAlignImageSpan extends ImageSpan {
|
||||
public CenterAlignImageSpan(Drawable drawable) {
|
||||
super(drawable);
|
||||
|
||||
}
|
||||
|
||||
public CenterAlignImageSpan(Bitmap b) {
|
||||
super(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(@NonNull Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom,
|
||||
@NonNull Paint paint) {
|
||||
|
||||
Drawable b = getDrawable();
|
||||
Paint.FontMetricsInt fm = paint.getFontMetricsInt();
|
||||
int transY = (y + fm.descent + y + fm.ascent) / 2 - b.getBounds().bottom / 2;//计算y方向的位移
|
||||
canvas.save();
|
||||
canvas.translate(x, transY);//绘制图片位移一段距离
|
||||
b.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
83
app/src/main/java/com/dskj/daikuan/utils/DeviceUtil.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
import android.os.StatFs;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
public final class DeviceUtil {
|
||||
|
||||
public static int SCREEN_WIDTH;
|
||||
public static int SCREEN_HEIGHT;
|
||||
|
||||
public static float DENSITY;
|
||||
public static float DENSITY_SCALE;
|
||||
public static int DENSITY_DPI;
|
||||
|
||||
public static void init(Context context) {
|
||||
if (null == context) return;
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
windowManager.getDefaultDisplay().getRealMetrics(displayMetrics);
|
||||
SCREEN_WIDTH = displayMetrics.widthPixels;
|
||||
SCREEN_HEIGHT = displayMetrics.heightPixels;
|
||||
DENSITY = displayMetrics.density;
|
||||
DENSITY_SCALE = displayMetrics.scaledDensity;
|
||||
DENSITY_DPI = displayMetrics.densityDpi;
|
||||
}
|
||||
|
||||
public static int dip2px(float dip) {
|
||||
return (int) (dip * DENSITY + 0.5F);
|
||||
}
|
||||
|
||||
public static boolean isStorageEnough(Context context, long minSize) {
|
||||
try {
|
||||
File path = Environment.getExternalStorageDirectory();
|
||||
StatFs stat = new StatFs(path.toString());
|
||||
long blocksize = stat.getBlockSizeLong();
|
||||
long availbleblocks = stat.getAvailableBlocksLong();
|
||||
long avilableSize = availbleblocks * blocksize;
|
||||
return avilableSize >= minSize;
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据手机的分辨率从 px(像素) 的单位 转成为 dp
|
||||
* @param context 上下文
|
||||
* @param pxValue px值
|
||||
* @return dp值
|
||||
*/
|
||||
public static int px2dip(Context context, float pxValue) {
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (pxValue / scale + 0.5f);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前的屏幕尺寸
|
||||
*
|
||||
* @param context {@link Context}
|
||||
* @return 屏幕尺寸
|
||||
*/
|
||||
public static int[] getScreenSize(Context context) {
|
||||
int[] size = new int[2];
|
||||
|
||||
WindowManager w = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
Display d = w.getDefaultDisplay();
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
d.getMetrics(metrics);
|
||||
|
||||
size[0] = metrics.widthPixels;
|
||||
size[1] = metrics.heightPixels;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
905
app/src/main/java/com/dskj/daikuan/utils/FileUtils.java
Normal file
@@ -0,0 +1,905 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.media.MediaScannerConnection;
|
||||
import android.net.Uri;
|
||||
import android.os.Environment;
|
||||
import android.os.StatFs;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import com.dskj.daikuan.InitApp;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
|
||||
public class FileUtils {
|
||||
public static String APP_DIR = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "bkwatermark" + File.separator;
|
||||
public static String THUMBNAIL_DIR = APP_DIR + ".thumbnailrecord" + File.separator;
|
||||
public static String TEMP_DIR = APP_DIR + "temprecord" + File.separator;
|
||||
//以下三个不能清理
|
||||
public static String IMAGE_DIR = APP_DIR + "tempimage" + File.separator;
|
||||
public static String VIDEO_DIR = APP_DIR + "recordvideo" + File.separator;
|
||||
public static String THUMB_DIR = APP_DIR + ".videothumb" + File.separator;
|
||||
public static String CAPTURER_DIR = APP_DIR + "recordscreen" + File.separator;
|
||||
//以上三个不能清理
|
||||
//以下的 结尾的两个mp4文件和ts文件不能清理
|
||||
public static String VIDEO_DIR_HIDE = APP_DIR + ".recordvideo" + File.separator;
|
||||
|
||||
/**
|
||||
* 从assets目录中复制整个文件夹内容到新的路径下
|
||||
* @param context Context 使用CopyFiles类的Activity
|
||||
* @param oldPath String 原文件路径 如:Data(assets文件夹下文件夹名称)
|
||||
* @param newPath String 复制后路径 如:data/data/(手机内部存储路径名称)
|
||||
*/
|
||||
public void copyFilesFromAssets(Context context,String oldPath,String newPath) {
|
||||
try {
|
||||
InputStream is = context.getAssets().open(oldPath);
|
||||
FileOutputStream fos = new FileOutputStream(new File(newPath));
|
||||
byte[] buffer = new byte[1024];
|
||||
int byteCount=0;
|
||||
while((byteCount=is.read(buffer))!=-1) {//循环从输入流读取 buffer字节
|
||||
fos.write(buffer, 0, byteCount);//将读取的输入流写入到输出流
|
||||
}
|
||||
fos.flush();//刷新缓冲区
|
||||
is.close();
|
||||
fos.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static String getFileNameNoEx(String filename) {
|
||||
if ((filename != null) && (filename.length() > 0)) {
|
||||
int dot = filename.lastIndexOf('.');
|
||||
if ((dot > -1) && (dot < (filename.length()))) {
|
||||
return filename.substring(0, dot);
|
||||
}
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
public static Uri getVideoContentUri(Context context, String path) {
|
||||
Uri uri = null;
|
||||
Cursor cursor = context.getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
|
||||
new String[]{MediaStore.Video.Media._ID}, MediaStore.Video.Media.DATA + "=? ",
|
||||
new String[]{path}, null);
|
||||
|
||||
if (cursor != null) {
|
||||
if (cursor.moveToFirst()) {
|
||||
int id = cursor.getInt(cursor.getColumnIndex(MediaStore.MediaColumns._ID));
|
||||
Uri baseUri = Uri.parse("content://media/external/video/media");
|
||||
uri = Uri.withAppendedPath(baseUri, "" + id);
|
||||
}
|
||||
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
if (uri == null) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(MediaStore.Video.Media.DATA, path);
|
||||
uri = context.getContentResolver().insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, values);
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
|
||||
|
||||
public static long getAvilableSize(){
|
||||
File path = Environment.getExternalStorageDirectory();
|
||||
StatFs stat = new StatFs(path.toString());
|
||||
long blocksize = stat.getBlockSizeLong();
|
||||
long availbleblocks = stat.getAvailableBlocksLong();
|
||||
long avilableSize = availbleblocks * blocksize;
|
||||
return avilableSize;
|
||||
}
|
||||
|
||||
public static long getDirectorySize(File directory) {
|
||||
final File[] files = directory.listFiles();
|
||||
long size = 0;
|
||||
|
||||
if (files == null) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
for (final File file : files) {
|
||||
try {
|
||||
if (!isSymlink(file)) {
|
||||
size += sizeOf(file);
|
||||
if (size < 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
// ignore exception when asking for symlink
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
/**
|
||||
* 检测文件是否可用
|
||||
*/
|
||||
public static boolean checkFile(String path) {
|
||||
if (!TextUtils.isEmpty(path)) {
|
||||
File f = new File(path);
|
||||
if (f != null && f.exists() && f.canRead() && (f.isDirectory() || (f.isFile()
|
||||
&& f.length() > 0))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getExtension(String name) {
|
||||
String ext;
|
||||
|
||||
if (name.lastIndexOf(".") == -1) {
|
||||
ext = "";
|
||||
|
||||
} else {
|
||||
int index = name.lastIndexOf(".");
|
||||
ext = name.substring(index + 1, name.length());
|
||||
}
|
||||
return ext;
|
||||
}
|
||||
|
||||
private static boolean isSymlink(File file) throws IOException {
|
||||
File fileInCanonicalDir;
|
||||
|
||||
if (file.getParent() == null) {
|
||||
fileInCanonicalDir = file;
|
||||
} else {
|
||||
File canonicalDir = file.getParentFile().getCanonicalFile();
|
||||
fileInCanonicalDir = new File(canonicalDir, file.getName());
|
||||
}
|
||||
|
||||
return !fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String getFileName(String path) {
|
||||
String s[] = path.split("/");
|
||||
if (s.length != 0)
|
||||
return "/" + s[s.length - 1];
|
||||
return "/";
|
||||
}
|
||||
/**
|
||||
* Return the name of file.
|
||||
*
|
||||
* @param file The file.
|
||||
* @return the name of file
|
||||
*/
|
||||
public static String getFileName(final File file) {
|
||||
if (file == null) return "";
|
||||
return getFileName(file.getAbsolutePath());
|
||||
}
|
||||
|
||||
private static long sizeOf(File file) {
|
||||
if (file.isDirectory()) {
|
||||
return getDirectorySize(file);
|
||||
} else {
|
||||
return file.length();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void writeTxtToFile(List<String> strcontent, String filePath, String fileName) {
|
||||
makeFilePath(filePath, fileName);
|
||||
String strFilePath = filePath + fileName;
|
||||
String strContent = "";
|
||||
|
||||
for (int i = 0; i < strcontent.size(); ++i) {
|
||||
strContent = strContent + "file " + strcontent.get(i) + "\r\n";
|
||||
}
|
||||
|
||||
try {
|
||||
File file = new File(strFilePath);
|
||||
if (file.isFile() && file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
|
||||
file.getParentFile().mkdirs();
|
||||
file.createNewFile();
|
||||
RandomAccessFile raf = new RandomAccessFile(file, "rwd");
|
||||
raf.seek(file.length());
|
||||
raf.write(strContent.getBytes());
|
||||
raf.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static boolean saveBitmap(Bitmap src, String dest) {
|
||||
if (src == null || TextUtils.isEmpty(dest)) {
|
||||
return false;
|
||||
}
|
||||
File destDir = new File(dest).getParentFile();
|
||||
if (destDir == null) {
|
||||
return false;
|
||||
}
|
||||
if (!destDir.exists()) {
|
||||
destDir.mkdirs();
|
||||
}
|
||||
|
||||
FileOutputStream fout = null;
|
||||
boolean success = false;
|
||||
try {
|
||||
fout = new FileOutputStream(dest);
|
||||
src.compress(Bitmap.CompressFormat.PNG, 100, fout);
|
||||
|
||||
success = true;
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
success = false;
|
||||
} finally {
|
||||
if (fout != null) {
|
||||
try {
|
||||
fout.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean saveBitmapPic(Context context,Bitmap src, String dest,String fileName) {
|
||||
if (src == null || TextUtils.isEmpty(dest)) {
|
||||
return false;
|
||||
}
|
||||
File destDir = new File(dest).getParentFile();
|
||||
if (destDir == null) {
|
||||
return false;
|
||||
}
|
||||
if (!destDir.exists()) {
|
||||
destDir.mkdirs();
|
||||
}
|
||||
|
||||
FileOutputStream fout = null;
|
||||
boolean success = false;
|
||||
try {
|
||||
fout = new FileOutputStream(dest);
|
||||
src.compress(Bitmap.CompressFormat.PNG, 100, fout);
|
||||
|
||||
|
||||
success = true;
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
success = false;
|
||||
} finally {
|
||||
if (fout != null) {
|
||||
try {
|
||||
fout.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
// 其次把文件插入到系统图库
|
||||
try {
|
||||
MediaStore.Images.Media.insertImage(context.getContentResolver(),
|
||||
dest, fileName, null);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String saveBitmap2Gallery(String dest,String fileName, Bitmap bitmap) {
|
||||
File mPicDir = new File(dest);
|
||||
|
||||
if (mPicDir == null) {
|
||||
return null;
|
||||
}
|
||||
if (!mPicDir.exists()) {
|
||||
mPicDir.mkdirs();
|
||||
}
|
||||
OutputStream out = null;
|
||||
String[] pathArray = null;
|
||||
String[] typeArray = null;
|
||||
String fialeN=null;
|
||||
try {
|
||||
// Android 10版本 创建文件夹不成功,这里没有过多去研究
|
||||
boolean isMk = mPicDir.mkdirs();
|
||||
Log.d("ImageUtils ", "isMk = " + isMk);
|
||||
File mPicFile = new File(mPicDir, fileName);
|
||||
String mPicPath = mPicFile.getAbsolutePath();
|
||||
Log.d("ImageUtils ", "mPicPath = " + mPicPath);
|
||||
pathArray = new String[]{mPicFile.getAbsolutePath()};
|
||||
typeArray = new String[]{"image/png"};
|
||||
ContentValues values = new ContentValues();
|
||||
ContentResolver resolver = InitApp.initApp.getContentResolver();
|
||||
values.put(MediaStore.Images.ImageColumns.DATA, mPicPath);
|
||||
values.put(MediaStore.Images.ImageColumns.DISPLAY_NAME, fileName);
|
||||
values.put(MediaStore.Images.ImageColumns.MIME_TYPE, "image/png");
|
||||
values.put(MediaStore.Images.ImageColumns.DATE_TAKEN, System.currentTimeMillis() + "");
|
||||
// 插入相册
|
||||
Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
|
||||
if (uri != null) {
|
||||
out = resolver.openOutputStream(uri);
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
|
||||
Log.d("ImageUtils ", "compress");
|
||||
}
|
||||
fialeN=fileName;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
fialeN=null;
|
||||
} finally {
|
||||
if (out != null) {
|
||||
try {
|
||||
out.flush();
|
||||
out.close();
|
||||
Log.d("ImageUtils", "finally close");
|
||||
// 扫描刷新
|
||||
MediaScannerConnection.scanFile(InitApp.initApp, pathArray, typeArray, (s, uri) -> Log.d("ImageUtils", "onScanCompleted s->" + s));
|
||||
return fialeN;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return fialeN;
|
||||
}
|
||||
|
||||
|
||||
public static File makeFilePath(String filePath, String fileName) {
|
||||
File file = null;
|
||||
makeRootDirectory(filePath);
|
||||
|
||||
try {
|
||||
file = new File(filePath + fileName);
|
||||
if (!file.exists()) {
|
||||
file.createNewFile();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
public static void makeRootDirectory(String filePath) {
|
||||
File file = null;
|
||||
|
||||
try {
|
||||
file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.i("error:", e + "");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归删除文件和文件夹
|
||||
*
|
||||
* @param file
|
||||
*/
|
||||
public static void deleteFileRecursively(File file) {
|
||||
if (file.isFile()) {
|
||||
file.delete();
|
||||
return;
|
||||
}
|
||||
if (file.isDirectory()) {
|
||||
File[] childFile = file.listFiles();
|
||||
if (childFile == null || childFile.length == 0) {
|
||||
file.delete();
|
||||
return;
|
||||
}
|
||||
for (File f : childFile) {
|
||||
deleteFileRecursively(f);
|
||||
}
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
|
||||
public static String md5(String content) {
|
||||
byte[] hash;
|
||||
try {
|
||||
hash = MessageDigest.getInstance("MD5").digest(content.getBytes("UTF-8"));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException("NoSuchAlgorithmException", e);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException("UnsupportedEncodingException", e);
|
||||
}
|
||||
|
||||
StringBuilder hex = new StringBuilder(hash.length * 2);
|
||||
for (byte b : hash) {
|
||||
if ((b & 0xFF) < 0x10) {
|
||||
hex.append("0");
|
||||
}
|
||||
hex.append(Integer.toHexString(b & 0xFF));
|
||||
}
|
||||
return hex.toString();
|
||||
}
|
||||
|
||||
public static String getSaveUpdateDirectory() {
|
||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
String rootDir = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "SuperRecord" + File.separator + "update" + File.separator;
|
||||
File file = new File(rootDir);
|
||||
if (!file.exists()) {
|
||||
if (!file.mkdirs()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return rootDir;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check the usability of the external storage.
|
||||
*
|
||||
* @return enable -> true, disable->false
|
||||
*/
|
||||
public static boolean isExternalStorageEnable() {
|
||||
String state = Environment.getExternalStorageState();
|
||||
return Environment.MEDIA_MOUNTED.equals(state);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the external storage file path
|
||||
*
|
||||
* @return the file path
|
||||
*/
|
||||
public static String getExternalStoragePath() {
|
||||
return getExternalStorageDir().getAbsolutePath();
|
||||
}
|
||||
|
||||
/**
|
||||
* get the external storage file
|
||||
*
|
||||
* @return the file
|
||||
*/
|
||||
public static File getExternalStorageDir() {
|
||||
return Environment.getExternalStorageDirectory();
|
||||
}
|
||||
|
||||
public static String handleSpaceFilePath(String path) {
|
||||
if (TextUtils.isEmpty(path) || !path.contains(" ")) {
|
||||
return path;
|
||||
}
|
||||
|
||||
File origin = new File(path);
|
||||
String fileName = origin.getName();
|
||||
if (fileName.contains(" ")) {
|
||||
fileName = fileName.replaceAll(" ", "");
|
||||
}
|
||||
|
||||
File targetDir = new File(TEMP_DIR);
|
||||
if (!targetDir.exists()) {
|
||||
targetDir.mkdirs();
|
||||
}
|
||||
|
||||
File after = new File(targetDir, fileName);
|
||||
copyFile(origin, after);
|
||||
return after.getAbsolutePath();
|
||||
}
|
||||
|
||||
|
||||
public static boolean copyFile(File src, File dest) {
|
||||
if (src == null || dest == null) {
|
||||
return false;
|
||||
}
|
||||
if (dest.exists()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (TextUtils.equals(src.getParent(), dest.getParent())) {
|
||||
return src.renameTo(dest);
|
||||
}
|
||||
|
||||
try {
|
||||
dest.createNewFile();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
FileChannel srcChannel = null;
|
||||
FileChannel dstChannel = null;
|
||||
|
||||
boolean result = false;
|
||||
try {
|
||||
srcChannel = new FileInputStream(src).getChannel();
|
||||
dstChannel = new FileOutputStream(dest).getChannel();
|
||||
srcChannel.transferTo(0, srcChannel.size(), dstChannel);
|
||||
result = true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
srcChannel.close();
|
||||
dstChannel.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String getTempDirectory() {
|
||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
File file = new File(TEMP_DIR);
|
||||
if (!file.exists()) {
|
||||
if (!file.mkdirs()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return TEMP_DIR;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSaveRecordDirectory() {
|
||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
File file = new File(VIDEO_DIR);
|
||||
if (!file.exists()) {
|
||||
if (!file.mkdirs()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return VIDEO_DIR;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSaveRecordPicDirectory() {
|
||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
File file = new File(THUMB_DIR);
|
||||
if (!file.exists()) {
|
||||
if (!file.mkdirs()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return THUMB_DIR;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String getSaveCacheDirectory() {
|
||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
String rootDir = Environment.getExternalStorageDirectory().getAbsolutePath()
|
||||
+ File.separator + "ScreenRecord"
|
||||
+ File.separator + "cache"
|
||||
+ File.separator + "frame" + File.separator;
|
||||
File file = new File(rootDir);
|
||||
if (file.exists()) {
|
||||
deleteDir(rootDir);
|
||||
}
|
||||
file.mkdirs();
|
||||
return rootDir;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSaveCoverDirectory() {
|
||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
String rootDir = Environment.getExternalStorageDirectory().getAbsolutePath()
|
||||
+ File.separator + "ScreenRecord"
|
||||
+ File.separator + "cache"
|
||||
+ File.separator + "cover" + File.separator;
|
||||
File file = new File(rootDir);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
return rootDir;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSaveScreenDirectory() {
|
||||
// if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
File file = new File(CAPTURER_DIR);
|
||||
if (!file.exists()) {
|
||||
if (!file.mkdirs()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return CAPTURER_DIR;
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
|
||||
public static void deleteDir(final String pPath) {
|
||||
File dir = new File(pPath);
|
||||
deleteDirWithFile(dir);
|
||||
}
|
||||
|
||||
public static void deleteDirWithFile(File dir) {
|
||||
if (dir == null || !dir.exists() || !dir.isDirectory())
|
||||
return;
|
||||
for (File file : dir.listFiles()) {
|
||||
if (file.isFile())
|
||||
file.delete();
|
||||
else if (file.isDirectory())
|
||||
deleteDirWithFile(file);
|
||||
}
|
||||
dir.delete();
|
||||
}
|
||||
|
||||
public static boolean fileIsExist(String filePath) {
|
||||
if (TextUtils.isEmpty(filePath)) return false;
|
||||
|
||||
File file = new File(filePath);
|
||||
return file.exists();
|
||||
}
|
||||
|
||||
|
||||
public static void deleteFile(String path) {
|
||||
if (TextUtils.isEmpty(path)) {
|
||||
return;
|
||||
}
|
||||
File file = new File(path);
|
||||
Log.i("XHXDEBUG","XHXDEBUG清理删除文件:"+path);
|
||||
if (file.exists() && file.isFile()) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isExists(String path) {
|
||||
if (TextUtils.isEmpty(path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
File file = new File(path);
|
||||
return file.exists();
|
||||
}
|
||||
|
||||
|
||||
public static Uri getImageContentUri(Context context, String filePath) {
|
||||
Cursor cursor = context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
||||
new String[]{MediaStore.Images.Media._ID}, MediaStore.Images.Media.DATA + "=? ",
|
||||
new String[]{filePath}, null);
|
||||
Uri uri = null;
|
||||
|
||||
if (cursor != null) {
|
||||
if (cursor.moveToFirst()) {
|
||||
int id = cursor.getInt(cursor.getColumnIndex(MediaStore.MediaColumns._ID));
|
||||
Uri baseUri = Uri.parse("content://media/external/images/media");
|
||||
uri = Uri.withAppendedPath(baseUri, "" + id);
|
||||
}
|
||||
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
if (uri == null) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(MediaStore.Images.Media.DATA, filePath);
|
||||
uri = context.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
|
||||
//存储assets中的文件到本地
|
||||
public static void getAssetsPath(Context context) {
|
||||
String fileName = "ic_share_image.jpeg";
|
||||
File testFolder = new File(APP_DIR + "/share");
|
||||
if (testFolder.exists() && testFolder.isDirectory()) {
|
||||
Log.d("", "test folder already exists");
|
||||
} else if (!testFolder.exists()) {
|
||||
testFolder.mkdir();
|
||||
}
|
||||
File modelFile = new File(testFolder, fileName);
|
||||
if (!modelFile.exists()) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
InputStream is = context.getAssets().open(fileName);
|
||||
FileOutputStream fos = new FileOutputStream(modelFile);
|
||||
byte[] buffer = new byte[8192];
|
||||
int read;
|
||||
try {
|
||||
while ((read = is.read(buffer)) != -1) {
|
||||
fos.write(buffer, 0, read);
|
||||
}
|
||||
} finally {
|
||||
fos.flush();
|
||||
fos.close();
|
||||
is.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.d("", "Can't copy test file onto SD card");
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
public static int saveImageToGalleryShare(Context mContext, Bitmap bmp, String fileName) {
|
||||
//生成路径
|
||||
String root = APP_DIR;
|
||||
String dirName = "tempimage";
|
||||
File appDir = new File(root, dirName);
|
||||
if (!appDir.exists()) {
|
||||
appDir.mkdirs();
|
||||
}
|
||||
//获取文件
|
||||
File file = new File(appDir, fileName);
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
fos = new FileOutputStream(file);
|
||||
bmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
|
||||
fos.flush();
|
||||
//通知系统相册刷新
|
||||
// mContext.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
|
||||
// Uri.fromFile(new File(file.getPath()))));
|
||||
//通知更新相册
|
||||
mContext.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(file)));
|
||||
|
||||
return 2;
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (fos != null) {
|
||||
fos.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Drawable转换成一个Bitmap
|
||||
*
|
||||
* @param drawable drawable对象
|
||||
* @return
|
||||
*/
|
||||
public static Bitmap drawableToBitmap(Drawable drawable) {
|
||||
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(),
|
||||
drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
drawable.draw(canvas);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* oldPath 和 newPath必须是新旧文件的绝对路径
|
||||
*/
|
||||
public static File renameFile(String oldPath, String newPath) {
|
||||
if (TextUtils.isEmpty(oldPath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(newPath)) {
|
||||
return null;
|
||||
}
|
||||
File oldFile = new File(oldPath);
|
||||
File newFile = new File(newPath);
|
||||
boolean b = oldFile.renameTo(newFile);
|
||||
File file2 = new File(newPath);
|
||||
return file2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单个文件
|
||||
*
|
||||
* @param filePath$Name 要删除的文件的文件名
|
||||
* @return 单个文件删除成功返回true,否则返回false
|
||||
*/
|
||||
public static boolean deleteSingleFile(String filePath$Name) {
|
||||
File file = new File(filePath$Name);
|
||||
// 如果文件路径所对应的文件存在,并且是一个文件,则直接删除
|
||||
if (file.exists() && file.isFile()) {
|
||||
if (file.delete()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制asset到片尾
|
||||
*/
|
||||
public static boolean copyAssetsToDst(Context context, String srcPath) {
|
||||
File targetDir0 = new File(APP_DIR);
|
||||
if (!targetDir0.exists()) {
|
||||
targetDir0.mkdirs();
|
||||
}
|
||||
|
||||
File targetDir = new File(VIDEO_DIR_HIDE);
|
||||
if (!targetDir.exists()) {
|
||||
targetDir.mkdirs();
|
||||
}
|
||||
|
||||
try {
|
||||
File outFile = new File(VIDEO_DIR_HIDE, srcPath);
|
||||
InputStream is = context.getAssets().open(srcPath);
|
||||
FileOutputStream fos = new FileOutputStream(outFile);
|
||||
byte[] buffer = new byte[1024];
|
||||
int byteCount;
|
||||
while ((byteCount = is.read(buffer)) != -1) {
|
||||
fos.write(buffer, 0, byteCount);
|
||||
}
|
||||
fos.flush();
|
||||
is.close();
|
||||
fos.close();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**读取assets文件*/
|
||||
public static String getFromAssets(Context context,String fileName) {
|
||||
try {
|
||||
InputStreamReader inputReader = new InputStreamReader(context.getResources().getAssets().open(fileName));
|
||||
BufferedReader bufReader = new BufferedReader(inputReader);
|
||||
String line = "";
|
||||
String Result = "";
|
||||
while ((line = bufReader.readLine()) != null)
|
||||
Result += line;
|
||||
return Result;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Java文件操作 获取文件扩展名
|
||||
*
|
||||
*/
|
||||
public static String getExtensionName(String filename) {
|
||||
if ((filename != null) && (filename.length() > 0)) {
|
||||
int dot = filename.lastIndexOf('.');
|
||||
if ((dot >-1) && (dot < (filename.length() - 1))) {
|
||||
return filename.substring(dot + 1);
|
||||
}
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
90
app/src/main/java/com/dskj/daikuan/utils/GsonUtils.java
Normal file
@@ -0,0 +1,90 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* json解析工具类 其实对于数组解析有一些问题
|
||||
* @author xuhuixiang
|
||||
*/
|
||||
public class GsonUtils {
|
||||
|
||||
public static Gson gson = new Gson();
|
||||
|
||||
/**
|
||||
* 返回List对象
|
||||
* @param str
|
||||
* @param type new TypeToken<ArrayList<T>>(){}.getType()
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> T getListFromJSON(String str, Type type) {
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
return gson.fromJson(str, type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回List对象
|
||||
* @param str
|
||||
* @param cls
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> List<T> getListFromJSON(String str, Class<T> cls)
|
||||
{
|
||||
Type type = new TypeToken<ArrayList<JsonObject>>()
|
||||
{}.getType();
|
||||
ArrayList<JsonObject> jsonObjects = gson.fromJson(str, type);
|
||||
ArrayList<T> arrayList = new ArrayList<>();
|
||||
for (JsonObject jsonObject : jsonObjects)
|
||||
{
|
||||
arrayList.add(gson.fromJson(jsonObject, cls));
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回对象
|
||||
* @param str
|
||||
* @param cls
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> T getObjFromJSON(String str, Class<T> cls) {
|
||||
// try {
|
||||
if (!TextUtils.isEmpty(str)) {
|
||||
return gson.fromJson(str, cls);
|
||||
}
|
||||
return null;
|
||||
// }catch (Exception e) {
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回JsonString
|
||||
* @return
|
||||
*/
|
||||
public static String beanToJSONString(Object bean) {
|
||||
return new Gson().toJson(bean);
|
||||
}
|
||||
|
||||
|
||||
public static String JSONTokener(String in) {
|
||||
// consume an optional byte order mark (BOM) if it exists
|
||||
if (in != null && in.startsWith("\ufeff")) {
|
||||
in = in.substring(1);
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
}
|
||||
146
app/src/main/java/com/dskj/daikuan/utils/LogUtils.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Log统一管理类
|
||||
* Created by xuhuixiang on 2015/10/19 0019.
|
||||
*/
|
||||
public class LogUtils {
|
||||
|
||||
private LogUtils() {
|
||||
throw new UnsupportedOperationException("cannot be instantiated");
|
||||
}
|
||||
|
||||
// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化
|
||||
public static boolean isDebug = true;// 是否需要打印bug,可以在application的onCreate函数里面初始化
|
||||
|
||||
private static final String TAG = "BIKAOVIDEO";
|
||||
|
||||
/**
|
||||
* 默认tag的函数
|
||||
*
|
||||
* @param msg 打印信息
|
||||
*/
|
||||
public static void v(String msg) {
|
||||
if (isDebug) Log.v(TAG, msg);
|
||||
}
|
||||
|
||||
public static void d(String msg) {
|
||||
if (isDebug) Log.d(TAG, msg);
|
||||
}
|
||||
|
||||
public static void i(String msg) {
|
||||
if (isDebug) {
|
||||
if (msg.length() > 4000) {
|
||||
Log.i(TAG, "BIKAOVIDEOsb.length = " + msg.length());
|
||||
int chunkCount = msg.length() / 4000; // integer division
|
||||
for (int i = 0; i <= chunkCount; i++) {
|
||||
int max = 4000 * (i + 1);
|
||||
if (max >= msg.length()) {
|
||||
Log.i(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i));
|
||||
} else {
|
||||
Log.i(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG, "BIKAOVIDEO" + msg.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void w(String msg) {
|
||||
if (isDebug) Log.w(TAG, msg);
|
||||
}
|
||||
|
||||
public static void e(String msg) {
|
||||
if (isDebug) {
|
||||
if (msg.length() > 4000) {
|
||||
Log.e(TAG, "sb.length = " + msg.length());
|
||||
int chunkCount = msg.length() / 4000; // integer division
|
||||
for (int i = 0; i <= chunkCount; i++) {
|
||||
int max = 4000 * (i + 1);
|
||||
if (max >= msg.length()) {
|
||||
Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i));
|
||||
} else {
|
||||
Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "XHX" + msg.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义lag的函数
|
||||
*
|
||||
* @param tag tag
|
||||
* @param msg 打印信息
|
||||
*/
|
||||
public static void v(String tag, String msg) {
|
||||
if (isDebug) Log.v(tag, msg);
|
||||
}
|
||||
|
||||
public static void d(String tag, String msg) {
|
||||
if (isDebug) Log.d(tag, msg);
|
||||
}
|
||||
|
||||
public static void i(String tag, String msg) {
|
||||
if (isDebug) {
|
||||
if (msg.length() > 4000) {
|
||||
Log.i(TAG, "sb.length = " + msg.length());
|
||||
int chunkCount = msg.length() / 4000; // integer division
|
||||
for (int i = 0; i <= chunkCount; i++) {
|
||||
int max = 4000 * (i + 1);
|
||||
if (max >= msg.length()) {
|
||||
Log.i(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i));
|
||||
} else {
|
||||
Log.i(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG, "XHX" + msg.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void w(String tag, String msg) {
|
||||
if (isDebug) Log.w(tag, msg);
|
||||
}
|
||||
|
||||
public static void e(String tag, String msg) {
|
||||
if (isDebug) Log.e(tag, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义lag的函数
|
||||
*
|
||||
* @param clazz 类
|
||||
* @param msg 打印信息
|
||||
*/
|
||||
public static void v(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.v(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
public static void d(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.d(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
public static void i(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.i(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
public static void w(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.w(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
public static void e(Class<?> clazz, String msg) {
|
||||
if (isDebug) Log.e(clazz.getSimpleName(), msg);
|
||||
}
|
||||
|
||||
}
|
||||
53
app/src/main/java/com/dskj/daikuan/utils/RxBus.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import rx.Observable;
|
||||
import rx.subjects.PublishSubject;
|
||||
import rx.subjects.SerializedSubject;
|
||||
import rx.subjects.Subject;
|
||||
|
||||
public class RxBus {
|
||||
|
||||
private static volatile RxBus instance;
|
||||
|
||||
private final Subject<Object, Object> bus;
|
||||
|
||||
private RxBus() {
|
||||
bus = new SerializedSubject<>(PublishSubject.create());
|
||||
}
|
||||
|
||||
/**
|
||||
* 单例模式RxBus
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static RxBus getInstance() {
|
||||
if (null == instance) {
|
||||
synchronized (RxBus.class) {
|
||||
if (null == instance) {
|
||||
instance = new RxBus();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*
|
||||
* @param o
|
||||
*/
|
||||
public void post(Object o) {
|
||||
bus.onNext(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据传递的 eventType 类型返回特定类型(eventType)的 被观察者
|
||||
*
|
||||
* @param eventType
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public <T> Observable<T> toObservable(Class<T> eventType) {
|
||||
return bus.ofType(eventType);
|
||||
}
|
||||
}
|
||||
10
app/src/main/java/com/dskj/daikuan/utils/ToastUtils.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class ToastUtils {
|
||||
public static void showShort(Context context,String name){
|
||||
Toast.makeText(context,name,Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.dskj.daikuan.viewModel.home;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.azhon.basic.lifecycle.BaseViewModel;
|
||||
import com.dskj.daikuan.InitApp;
|
||||
import com.dskj.daikuan.api.Api;
|
||||
import com.dskj.daikuan.api.BaseObserver;
|
||||
import com.dskj.daikuan.api.Result;
|
||||
import com.dskj.daikuan.bean.ErrorMesage;
|
||||
import com.dskj.daikuan.bean.VideoIndexBean;
|
||||
import com.dskj.daikuan.bean.VideoIndexResult;
|
||||
import com.dskj.daikuan.bean.VideoResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class MainViewModel extends BaseViewModel {
|
||||
|
||||
private MutableLiveData<ErrorMesage> errorMesageMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<ErrorMesage> getErrorMesageMutableLiveData() {
|
||||
return errorMesageMutableLiveData;
|
||||
}
|
||||
|
||||
protected MutableLiveData<List<VideoIndexBean>> videoIndexBeanMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<List<VideoIndexBean>> getVideoIndexBeanMutableLiveData() {
|
||||
return videoIndexBeanMutableLiveData;
|
||||
}
|
||||
|
||||
protected MutableLiveData<VideoResult> videoResultMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<VideoResult> getVideoResultMutableLiveData() {
|
||||
return videoResultMutableLiveData;
|
||||
}
|
||||
|
||||
public void videoIndex() {
|
||||
|
||||
Api.getInstance().videoIndex("")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<VideoIndexResult>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<VideoIndexResult> feedbackResp) {
|
||||
getVideoIndexBeanMutableLiveData().postValue(feedbackResp.d.getVideo_category());
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code, msg));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void videoList(String id,String page) {
|
||||
|
||||
Api.getInstance().videoList(InitApp.getToken(),id,"video",page,"1")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<VideoResult>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<VideoResult> feedbackResp) {
|
||||
VideoResult videoResult = feedbackResp.d;
|
||||
videoResult.setCategoryId(id);
|
||||
getVideoResultMutableLiveData().postValue(videoResult);
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code, msg));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void search(String key,String page) {
|
||||
|
||||
Api.getInstance().search(InitApp.getToken(),key,"20",page,"video")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<VideoResult>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<VideoResult> feedbackResp) {
|
||||
VideoResult videoResult = feedbackResp.d;
|
||||
videoResult.setCategoryId("999");
|
||||
getVideoResultMutableLiveData().postValue(videoResult);
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code, msg));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void videoPlay(String id) {
|
||||
|
||||
Api.getInstance().videoPlay(InitApp.getToken(),id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result feedbackResp) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code, msg));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.dskj.daikuan.viewModel.home;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* Created by shuyu on 2016/12/7.
|
||||
*/
|
||||
|
||||
public class SwitchVideoModel {
|
||||
private String url;
|
||||
private String name;
|
||||
|
||||
public SwitchVideoModel(String name, String url) {
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.hitomi.tilibrary.transfer;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.SparseArray;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.hitomi.tilibrary.style.IProgressIndicator;
|
||||
|
||||
/**
|
||||
* 图片加载时使用 Android 默认的 ProgressBar
|
||||
* <p>
|
||||
* email: 196425254@qq.com
|
||||
*/
|
||||
public class ProgressBarIndicatorNew implements IProgressIndicator {
|
||||
|
||||
// private SparseArray<ProgressBar> progressBarArray = new SparseArray<>();
|
||||
|
||||
// private int dip2Px(Context context, float dpValue) {
|
||||
//// final float scale = context.getResources().getDisplayMetrics().density;
|
||||
//// return (int) (dpValue * scale + 0.5f);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void attach(int position, FrameLayout parent) {
|
||||
// Context context = parent.getContext();
|
||||
//
|
||||
// int progressSize = dip2Px(context, 50);
|
||||
// FrameLayout.LayoutParams progressLp = new FrameLayout.LayoutParams(
|
||||
// progressSize, progressSize);
|
||||
// progressLp.gravity = Gravity.CENTER;
|
||||
//
|
||||
// ProgressBar progressBar = new ProgressBar(context);
|
||||
// progressBar.setLayoutParams(progressLp);
|
||||
//
|
||||
// parent.addView(progressBar, parent.getChildCount());
|
||||
// progressBarArray.put(position, progressBar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideView(int position) {
|
||||
// ProgressBar progressBar = progressBarArray.get(position);
|
||||
// if (progressBar != null)
|
||||
// progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(int position) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(int position, int progress) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish(int position) {
|
||||
// ProgressBar progressBar = progressBarArray.get(position);
|
||||
// if (progressBar == null) return;
|
||||
//
|
||||
// ViewGroup vg = (ViewGroup) progressBar.getParent();
|
||||
// ;
|
||||
// if (vg != null) {
|
||||
// vg.removeView(progressBar);
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
package com.hitomi.tilibrary.transfer;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.view.KeyEvent;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.hitomi.tilibrary.style.index.CircleIndexIndicator;
|
||||
import com.hitomi.tilibrary.style.progress.ProgressBarIndicator;
|
||||
import com.hitomi.tilibrary.utils.AppManager;
|
||||
import com.hitomi.tilibrary.utils.FileUtils;
|
||||
import com.hitomi.tilibrary.view.video.ExoVideoView;
|
||||
import com.hitomi.tilibrary.view.video.source.ExoSourceManager;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Main workflow: <br/>
|
||||
* 1、点击缩略图展示缩略图到 transferee 过渡动画 <br/>
|
||||
* 2、显示下载高清图片进度 <br/>
|
||||
* 3、加载完成显示高清图片 <br/>
|
||||
* 4、高清图支持手势缩放 <br/>
|
||||
* 5、关闭 transferee 展示 transferee 到原缩略图的过渡动画 <br/>
|
||||
* Created by Vans Z on 2017/1/19.
|
||||
* <p>
|
||||
* email: 196425254@qq.com
|
||||
*/
|
||||
public class TransfereeNew implements DialogInterface.OnShowListener,
|
||||
DialogInterface.OnKeyListener,
|
||||
TransferLayout.OnLayoutResetListener,
|
||||
AppManager.OnAppStateChangeListener {
|
||||
|
||||
private Context context;
|
||||
private Dialog transDialog;
|
||||
|
||||
private TransferLayout transLayout;
|
||||
private TransferConfig transConfig;
|
||||
private OnTransfereeStateChangeListener transListener;
|
||||
|
||||
// 因为Dialog的关闭有动画延迟,固不能使用 dialog.isShowing, 去判断 transferee 的显示逻辑
|
||||
private boolean shown;
|
||||
|
||||
/**
|
||||
* 构造方法私有化,通过{@link #getDefault(Context)} 创建 transferee
|
||||
*
|
||||
* @param context 上下文环境
|
||||
*/
|
||||
private TransfereeNew(Context context) {
|
||||
this.context = context;
|
||||
createLayout();
|
||||
createDialog();
|
||||
AppManager.getInstance().init((Application) context.getApplicationContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @return {@link TransfereeNew}
|
||||
*/
|
||||
public static TransfereeNew getDefault(Context context) {
|
||||
return new TransfereeNew(context);
|
||||
}
|
||||
|
||||
private void createLayout() {
|
||||
transLayout = new TransferLayout(context);
|
||||
transLayout.setOnLayoutResetListener(this);
|
||||
}
|
||||
|
||||
private void createDialog() {
|
||||
transDialog = new AlertDialog.Builder(context,
|
||||
android.R.style.Theme_Translucent_NoTitleBar_Fullscreen)
|
||||
.setView(transLayout)
|
||||
.create();
|
||||
transDialog.setOnShowListener(this);
|
||||
transDialog.setOnKeyListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查参数,如果必须参数缺少,就使用缺省参数或者抛出异常
|
||||
*/
|
||||
private void checkConfig() {
|
||||
if (transConfig == null)
|
||||
throw new IllegalArgumentException("The parameter TransferConfig can't be null");
|
||||
if (transConfig.isSourceEmpty())
|
||||
throw new IllegalArgumentException("The parameter sourceUrlList or sourceUriList can't be empty");
|
||||
if (transConfig.getImageLoader() == null)
|
||||
throw new IllegalArgumentException("Need to specify an ImageLoader");
|
||||
|
||||
transConfig.setNowThumbnailIndex(Math.max(transConfig.getNowThumbnailIndex(), 0));
|
||||
transConfig.setOffscreenPageLimit(transConfig.getOffscreenPageLimit() <= 0
|
||||
? 1 : transConfig.getOffscreenPageLimit());
|
||||
transConfig.setDuration(transConfig.getDuration() <= 0
|
||||
? 300 : transConfig.getDuration());
|
||||
transConfig.setProgressIndicator(transConfig.getProgressIndicator() == null
|
||||
? new ProgressBarIndicator() : transConfig.getProgressIndicator());
|
||||
transConfig.setIndexIndicator(transConfig.getIndexIndicator() == null
|
||||
? new CircleIndexIndicator() : transConfig.getIndexIndicator());
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置 transferee 参数对象
|
||||
*
|
||||
* @param config 参数对象
|
||||
* @return transferee
|
||||
*/
|
||||
public TransfereeNew apply(TransferConfig config) {
|
||||
if (!shown) {
|
||||
transConfig = config;
|
||||
OriginalViewHelper.getInstance().fillOriginImages(config);
|
||||
checkConfig();
|
||||
transLayout.apply(config);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* transferee 是否显示
|
||||
*
|
||||
* @return true :显示, false :关闭
|
||||
*/
|
||||
public boolean isShown() {
|
||||
return shown;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示 transferee
|
||||
*/
|
||||
public void show() {
|
||||
if (shown) return;
|
||||
transDialog.show();
|
||||
adjustTopAndBottom();
|
||||
if (transListener != null) {
|
||||
transListener.onShow();
|
||||
}
|
||||
shown = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示 transferee, 并设置 OnTransfereeChangeListener
|
||||
*
|
||||
* @param listener {@link OnTransfereeStateChangeListener}
|
||||
*/
|
||||
public void show(OnTransfereeStateChangeListener listener) {
|
||||
if (shown || listener == null) return;
|
||||
transDialog.show();
|
||||
adjustTopAndBottom();
|
||||
transListener = listener;
|
||||
transListener.onShow();
|
||||
shown = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭 transferee
|
||||
*/
|
||||
public void dismiss() {
|
||||
if (shown && transLayout.dismiss(transConfig.getNowThumbnailIndex())) {
|
||||
shown = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图片文件
|
||||
*/
|
||||
public File getImageFile(String imageUrl) {
|
||||
return transConfig.getImageLoader().getCache(imageUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除 transferee 缓存,包括图片和视频文件缓存,注意清除视频缓存必须保证 transferee 是关闭状态
|
||||
*/
|
||||
public void clear() {
|
||||
if (transConfig != null && transConfig.getImageLoader() != null) {
|
||||
transConfig.getImageLoader().clearCache();
|
||||
}
|
||||
File cacheFile = new File(context.getCacheDir(), ExoVideoView.CACHE_DIR);
|
||||
if (cacheFile.exists() && !shown) {
|
||||
FileUtils.deleteDir(new File(cacheFile, VideoThumbState.FRAME_DIR));
|
||||
ExoSourceManager.clearCache(context, cacheFile, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* dialog 打开时的监听器
|
||||
*/
|
||||
@Override
|
||||
public void onShow(DialogInterface dialog) {
|
||||
AppManager.getInstance().register(this);
|
||||
transLayout.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 调整顶部和底部内边距
|
||||
*/
|
||||
private void adjustTopAndBottom() {
|
||||
if (context instanceof Activity) {
|
||||
// 隐藏状态栏和导航栏,全屏化
|
||||
Activity activity = (Activity) context;
|
||||
ImmersionBar.with(activity, transDialog)
|
||||
.fullScreen(true)
|
||||
.init();
|
||||
// int top = ImmersionBar.getNotchHeight(activity);
|
||||
// int bottom = ImmersionBar.getNavigationBarHeight(activity);
|
||||
transLayout.setPadding(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReset() {
|
||||
AppManager.getInstance().unregister(this);
|
||||
transDialog.dismiss();
|
||||
if (transListener != null)
|
||||
transListener.onDismiss();
|
||||
shown = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK &&
|
||||
event.getAction() == KeyEvent.ACTION_UP &&
|
||||
!event.isCanceled()) {
|
||||
dismiss();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onForeground() {
|
||||
transLayout.pauseOrPlayVideo(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackground() {
|
||||
transLayout.pauseOrPlayVideo(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 Transferee 显示和关闭的监听器
|
||||
*
|
||||
* @param listener {@link OnTransfereeStateChangeListener}
|
||||
*/
|
||||
public void setOnTransfereeStateChangeListener(OnTransfereeStateChangeListener listener) {
|
||||
transListener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* 资源销毁,防止内存泄漏
|
||||
*/
|
||||
public void destroy() {
|
||||
if (transConfig != null) {
|
||||
transConfig.destroy();
|
||||
transConfig = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Transferee 显示的时候调用 {@link OnTransfereeStateChangeListener#onShow()}
|
||||
* <p>
|
||||
* Transferee 关闭的时候调用 {@link OnTransfereeStateChangeListener#onDismiss()}
|
||||
*/
|
||||
public interface OnTransfereeStateChangeListener {
|
||||
void onShow();
|
||||
|
||||
void onDismiss();
|
||||
}
|
||||
|
||||
public interface OnTransfereeLongClickListener {
|
||||
void onLongClick(ImageView imageView, String imageUri, int pos);
|
||||
}
|
||||
|
||||
}
|
||||
7
app/src/main/res/anim/animate.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layoutAnimation
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:animation="@anim/item_animation_fall_down"
|
||||
android:delay="15%"
|
||||
android:animationOrder="normal"
|
||||
/>
|
||||
20
app/src/main/res/anim/item_animation_fall_down.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="500">
|
||||
<translate
|
||||
android:fromYDelta="-20%"
|
||||
android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:toYDelta="0"></translate>
|
||||
<alpha
|
||||
android:fromAlpha="0"
|
||||
android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:toAlpha="1"></alpha>
|
||||
<scale
|
||||
android:fromXScale="105%"
|
||||
android:fromYScale="105%"
|
||||
android:interpolator="@android:anim/decelerate_interpolator"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:toXScale="100%"
|
||||
android:toYScale="100%"></scale>
|
||||
</set>
|
||||
7
app/src/main/res/color/select_color.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/colorPrimary" android:state_checked="true" />
|
||||
<item android:color="@color/color_999999" android:state_checked="false"/>
|
||||
</selector>
|
||||
|
||||
7
app/src/main/res/color/select_color1.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/white" android:state_checked="true" />
|
||||
<item android:color="@color/colorAccent" android:state_checked="false"/>
|
||||
</selector>
|
||||
|
||||
30
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/actionbar_bg.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient android:startColor="#E5D6FF"
|
||||
android:endColor="#E3EFFF"
|
||||
android:type="linear"
|
||||
android:gradientRadius="10dp"/>
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/bg_ripple.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:color="@color/gray_line_light"
|
||||
tools:ignore="MissingDefaultResource"> <!--波纹颜色-->
|
||||
</ripple>
|
||||
9
app/src/main/res/drawable/dlg_input_video_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"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="8dp" />
|
||||
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
</shape>
|
||||
170
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
25
app/src/main/res/drawable/inputbg.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@color/transparent" />
|
||||
<corners android:radius="@dimen/dp5" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:startColor="#FBF7F8"
|
||||
android:endColor="#FBF7F8"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<stroke android:color="#FBF7F8" android:width="1dp"/>
|
||||
<corners
|
||||
android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
25
app/src/main/res/drawable/inputbg_false.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@color/transparent" />
|
||||
<corners android:radius="@dimen/dp5" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:startColor="@color/transparent"
|
||||
android:endColor="@color/transparent"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<stroke android:color="#000019" android:width="1dp"/>
|
||||
<corners
|
||||
android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
25
app/src/main/res/drawable/inputbg_true.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@color/transparent" />
|
||||
<corners android:radius="@dimen/dp5" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:startColor="@color/transparent"
|
||||
android:endColor="@color/transparent"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<stroke android:color="@color/color_e12d48" android:width="1dp"/>
|
||||
<corners
|
||||
android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
25
app/src/main/res/drawable/item_bg_default.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@color/transparent" />
|
||||
<corners android:radius="@dimen/dp10" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:startColor="#E12D48"
|
||||
android:endColor="#E12D48"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<stroke android:color="#E12D48" android:width="0.5dp"/>
|
||||
<corners
|
||||
android:radius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
25
app/src/main/res/drawable/item_bg_default1.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/white">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape>
|
||||
<solid android:color="@color/transparent" />
|
||||
<corners android:radius="@dimen/dp5" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- 默认显⽰效果-->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:startColor="#E12D48"
|
||||
android:endColor="#E12D48"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<stroke android:color="#E12D48" android:width="0.5dp"/>
|
||||
<corners
|
||||
android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
|
||||
28
app/src/main/res/drawable/jz_bottom_seek_progress.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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>
|
||||
<solid android:color="#a5ffffff" />
|
||||
<size android:height="4dp" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<clip>
|
||||
<shape>
|
||||
<solid android:color="#ffffffff" />
|
||||
<size android:height="4dp" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<solid android:color="@color/color_fe8b59" />
|
||||
<size android:height="4dp" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
||||
9
app/src/main/res/drawable/jz_seek_post.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/color_fe8b59" />
|
||||
<size
|
||||
android:width="8dp"
|
||||
android:height="15dp" />
|
||||
<corners android:radius="2dp"/>
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/save_btn_back.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="15dp"/>
|
||||
<solid android:color="@color/color_fe8b59"/>
|
||||
</shape>
|
||||
19
app/src/main/res/drawable/search_bg.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<item android:gravity="center">
|
||||
<shape>
|
||||
<size
|
||||
android:height="@dimen/dp30" />
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:startColor="@color/color_search_2"
|
||||
android:endColor="@color/color_search_1"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners android:radius="@dimen/dp15"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
32
app/src/main/res/drawable/tab_line.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<item android:gravity="center">
|
||||
<shape>
|
||||
<size
|
||||
android:width="@dimen/dp30"
|
||||
android:height="@dimen/dp4" />
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:startColor="@color/color_fe8b59"
|
||||
android:endColor="@color/color_e83126"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners android:radius="@dimen/dp2"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:gravity="center">
|
||||
<shape>
|
||||
<size
|
||||
android:width="@dimen/dp60"
|
||||
android:height="@dimen/dp4" />
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:startColor="@color/transparent"
|
||||
android:endColor="@color/transparent"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
15
app/src/main/res/drawable/tab_line1.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<item android:gravity="center">
|
||||
<shape>
|
||||
<size
|
||||
android:width="@dimen/dp80"
|
||||
android:height="@dimen/dp30" />
|
||||
<solid android:color="@color/color_e83126" />
|
||||
<corners android:radius="@dimen/dp2"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
120
app/src/main/res/layout/activity_login.xml
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="model"
|
||||
type="com.dskj.daikuan.viewModel.home.MainViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp100"
|
||||
android:layout_height="@dimen/dp100"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="74dp"
|
||||
android:src="@mipmap/logo_img" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/name_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp60"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginLeft="@dimen/dp30"
|
||||
android:layout_marginTop="240dp"
|
||||
android:layout_marginRight="@dimen/dp30"
|
||||
android:background="@mipmap/edit_false"
|
||||
android:hint="请输入您的账号/手机号"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/pass_et"
|
||||
android:layout_below="@id/name_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp30"
|
||||
android:layout_marginRight="@dimen/dp30"
|
||||
android:layout_height="@dimen/dp60"
|
||||
android:layout_marginTop="26dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="textPassword"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:hint="请输入您的密码"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textColor="#ffffffff"
|
||||
android:background="@mipmap/edit_false"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/invcode_et"
|
||||
android:layout_below="@id/pass_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp30"
|
||||
android:layout_marginRight="@dimen/dp30"
|
||||
android:layout_height="@dimen/dp60"
|
||||
android:layout_marginTop="26dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="textPassword"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:hint="请输入邀请码"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textColor="#ffffffff"
|
||||
android:background="@mipmap/edit_false"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/get_code_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp60"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_alignRight="@id/pass_et"
|
||||
android:layout_alignTop="@id/pass_et"
|
||||
android:layout_marginRight="@dimen/dp10"
|
||||
android:text="获取验证码"
|
||||
android:visibility="gone"
|
||||
android:textColor="#ffe12d48"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/login_bt"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_below="@id/invcode_et"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="70dp"
|
||||
android:background="@drawable/item_bg_default1"
|
||||
android:text="登录"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/forget_pass_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/login_bt"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp40"
|
||||
android:text="忘记密码"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:src="@mipmap/login_bot" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
||||
103
app/src/main/res/layout/activity_main2.xml
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="model"
|
||||
type="com.dskj.daikuan.viewModel.home.MainViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_ly_f"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:orientation="horizontal"
|
||||
android:paddingRight="@dimen/dp15">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:textColor="@color/black"
|
||||
android:text="贷款列表"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/menu_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/bg_ripple"
|
||||
android:src="@mipmap/add_img"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/nodate_ry"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_ly_f">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp180"
|
||||
android:text="没有贷款信息"
|
||||
android:drawableTop="@mipmap/nodate_img"
|
||||
android:textColor="#19000019"
|
||||
android:textSize="18sp"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="50dp"
|
||||
android:text="申请贷款"
|
||||
android:textSize="@dimen/sp16"
|
||||
android:background="@drawable/item_bg_default1"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="85dp"
|
||||
android:textColor="@color/white"
|
||||
android:id="@+id/tijiao_bt"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/top_ly_f"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:visibility="gone"
|
||||
app:srlAccentColor="@color/color_e12d48">
|
||||
|
||||
<com.dskj.daikuan.ui.view.BezierCircleHeader
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp35"
|
||||
android:layout_marginRight="@dimen/dp35"
|
||||
android:overScrollMode="never">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
361
app/src/main/res/layout/activity_shenqing.xml
Normal file
@@ -0,0 +1,361 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="model"
|
||||
type="com.dskj.daikuan.viewModel.home.MainViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/top_ly_f"
|
||||
layout="@layout/layout_action_bar1" />
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_below="@id/top_ly_f">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/dp35"
|
||||
android:paddingRight="@dimen/dp35"
|
||||
android:paddingTop="@dimen/dp15"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="姓名/Full Name:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fullname_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="大马卡/IC:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ic_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/dp15"
|
||||
android:paddingBottom="@dimen/dp5">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/renxiang_cy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/dp6"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.dskj.daikuan.ui.view.CircleImageView
|
||||
android:id="@+id/zhengmian_iv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/sfzzm"
|
||||
app:ease_radius="@dimen/dp8"
|
||||
app:es_shape_type="rectangle"
|
||||
app:layout_constraintDimensionRatio="152:100"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</com.dskj.daikuan.ui.view.CircleImageView>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/sfz_add_img"
|
||||
app:layout_constraintBottom_toBottomOf="@id/zhengmian_iv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="IC-人像面"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/zhengmian_iv" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/guohui_cy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp6"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.dskj.daikuan.ui.view.CircleImageView
|
||||
android:id="@+id/fanmian_iv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/sfzbm"
|
||||
app:ease_radius="@dimen/dp8"
|
||||
app:es_shape_type="rectangle"
|
||||
app:layout_constraintDimensionRatio="152:100"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</com.dskj.daikuan.ui.view.CircleImageView>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/sfz_add_img"
|
||||
app:layout_constraintBottom_toBottomOf="@id/fanmian_iv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="IC-国徽面 "
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/fanmian_iv" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="电话号码/Phone number:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
<EditText
|
||||
android:id="@+id/phone_number_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:inputType="phone"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="职业/Occupation:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/occupation_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="地址/Address:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/address_et"
|
||||
android:layout_width="match_parent"
|
||||
android:minHeight="@dimen/dp44"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="收款银行/Beneficiary Bank:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/beneficiary_bank_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp44"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:src="@mipmap/select_img"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_alignParentRight="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="户口号码 /Beneficiary Account No:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/beneficiary_account_no_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="薪水/salary:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/salary_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="贷款金额/Loan amount :"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/loan_amount_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_height="100dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/login_bt"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:background="@drawable/item_bg_default1"
|
||||
android:text="提交申请"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
38
app/src/main/res/layout/activity_start_up.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="model"
|
||||
type="com.dskj.daikuan.viewModel.home.MainViewModel" />
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/show_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ui.activity.StartUpActivity">
|
||||
|
||||
<com.dskj.daikuan.ui.view.CircleImageView
|
||||
android:layout_width="@dimen/dp100"
|
||||
android:layout_height="@dimen/dp100"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@mipmap/logo_img"
|
||||
android:layout_marginTop="74dp"
|
||||
app:ease_border_color="@color/color_F8F8F8"
|
||||
app:ease_border_width="1dp"
|
||||
app:es_shape_type="round" />
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/login_bot"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
353
app/src/main/res/layout/activity_xiangqing.xml
Normal file
@@ -0,0 +1,353 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="model"
|
||||
type="com.dskj.daikuan.viewModel.home.MainViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/top_ly_f"
|
||||
layout="@layout/layout_action_bar1" />
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_below="@id/top_ly_f">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/dp35"
|
||||
android:paddingRight="@dimen/dp35"
|
||||
android:paddingTop="@dimen/dp15"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@mipmap/top_bg">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="张启山"
|
||||
android:layout_marginLeft="@dimen/dp20"
|
||||
android:layout_marginTop="20dp"
|
||||
android:id="@+id/fullname_et"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="30sp"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp20"
|
||||
android:text="姓名/Full Name:"
|
||||
android:layout_marginTop="@dimen/dp2"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="大马卡/IC:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ic_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/dp15"
|
||||
android:paddingBottom="@dimen/dp5">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/renxiang_cy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/dp6"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.dskj.daikuan.ui.view.CircleImageView
|
||||
android:id="@+id/zhengmian_iv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/sfzzm"
|
||||
app:ease_radius="@dimen/dp8"
|
||||
app:es_shape_type="rectangle"
|
||||
app:layout_constraintDimensionRatio="152:100"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</com.dskj.daikuan.ui.view.CircleImageView>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="IC-人像面"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/zhengmian_iv" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/guohui_cy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp6"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.dskj.daikuan.ui.view.CircleImageView
|
||||
android:id="@+id/fanmian_iv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/sfzbm"
|
||||
app:ease_radius="@dimen/dp8"
|
||||
app:es_shape_type="rectangle"
|
||||
app:layout_constraintDimensionRatio="152:100"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</com.dskj.daikuan.ui.view.CircleImageView>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="IC-国徽面 "
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/fanmian_iv" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="电话号码/Phone number:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/phone_number_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:inputType="phone"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="职业/Occupation:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/occupation_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="地址/Address:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/address_et"
|
||||
android:layout_width="match_parent"
|
||||
android:minHeight="@dimen/dp44"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="收款银行/Beneficiary Bank:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/beneficiary_bank_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp44"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:src="@mipmap/select_img"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_alignParentRight="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="户口号码 /Beneficiary Account No:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/beneficiary_account_no_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="薪水/salary:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/salary_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="贷款金额/Loan amount :"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loan_amount_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_height="100dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/login_bt"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:background="@drawable/item_bg_default1"
|
||||
android:text="提交申请"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
64
app/src/main/res/layout/agent_child_item.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?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:id="@+id/big_ly"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="13dp"
|
||||
android:background="@drawable/item_bg_default"
|
||||
android:layout_height="75dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="17dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="代收账金额 第11期"
|
||||
android:textColor="#80ffffff"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="9dp"
|
||||
android:layout_marginRight="17dp"
|
||||
android:text="代收账金额 第11期"
|
||||
android:textColor="#80ffffff"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/number_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title_tv"
|
||||
android:layout_marginLeft="17dp"
|
||||
android:layout_marginTop="@dimen/dp5"
|
||||
android:text="$98724.10"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/status_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@id/name_tv"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:layout_marginRight="17dp"
|
||||
android:text="贷款审批中"
|
||||
android:textColor="#ff750000"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
49
app/src/main/res/layout/layout_action_bar1.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top_ly_f"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:orientation="horizontal"
|
||||
android:paddingRight="@dimen/dp15">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="@dimen/dp40"
|
||||
android:layout_height="@dimen/dp40"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleType="centerInside"
|
||||
android:background="@drawable/bg_ripple"
|
||||
android:src="@mipmap/ic_black_back" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/menu_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp14"
|
||||
android:background="@drawable/bg_ripple"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
43
app/src/main/res/layout/layout_custom.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/down_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="保存"
|
||||
android:paddingLeft="14dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingRight="14dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:visibility="visible"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/color_333333"
|
||||
android:background="@drawable/save_btn_back" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numIndicator_float"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="1/1"
|
||||
android:shadowDx="2"
|
||||
android:shadowDy="2"
|
||||
android:shadowRadius="1"
|
||||
android:shadowColor="#CCCCCC"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#ffffff" />
|
||||
</RelativeLayout>
|
||||
18
app/src/main/res/layout/switch_video_dialog.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#B43A3A3A"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/switch_dialog_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@null"
|
||||
android:cacheColorHint="#00000000"
|
||||
android:divider="#ccc"
|
||||
android:dividerHeight="1px"
|
||||
android:listSelector="#00000000" />
|
||||
|
||||
</LinearLayout>
|
||||
14
app/src/main/res/layout/switch_video_dialog_item.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#00000000"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="15sp">
|
||||
|
||||
</TextView>
|
||||
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 982 B |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xhdpi/more_live_right_img.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/add_img.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/edit_false.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/edit_true.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_black_back.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_black_back_white.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/login_bot.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/logo_img.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/nodate_img.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/select_img.png
Normal file
|
After Width: | Height: | Size: 915 B |
BIN
app/src/main/res/mipmap-xxhdpi/sese.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/sfz_add_img.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/sfzbm.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/sfzzm.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/top_bg.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/new_bg_index.png
Normal file
|
After Width: | Height: | Size: 264 KiB |
76
app/src/main/res/values-night/colors.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#000000</color>
|
||||
<color name="colorPrimary">#E83126</color>
|
||||
<color name="color_2062D3">#2062D3</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="color_7B7888">#7B7888</color>
|
||||
<color name="color_8C8D92">#8C8D92</color>
|
||||
<color name="transparent">#00000000</color>
|
||||
<color name="color_222222">#222222</color>
|
||||
<color name="white11">#F4F6F8</color>
|
||||
<color name="color_24272E">#24272E</color>
|
||||
<color name="text_red">#DD493D</color>
|
||||
<color name="color_F5F3F8">#F5F3F8</color>
|
||||
<color name="color_FE6A9E">#FE6A9E</color>
|
||||
<color name="color_99FFFFFF">#99FFFFFF</color>
|
||||
<color name="color_993376EA">#993376EA</color>
|
||||
<color name="color_e1e3e6">#e1e3e6</color>
|
||||
<color name="gray_line_light">#eeeeee</color>
|
||||
<color name="color_AAAAAA">#AAAAAA</color>
|
||||
<color name="color_F8F8F8">#F8F8F8</color>
|
||||
<color name="color_333333">#BBBBBB</color>
|
||||
<color name="color_C4C4C4">#C4C4C4</color>
|
||||
<color name="color_999999">#66000000</color>
|
||||
<color name="color_F4F4F4">#F4F4F4</color>
|
||||
<color name="color_E7EAF9">#E7EAF9</color>
|
||||
<color name="color_777777">#777777</color>
|
||||
<color name="color_E8ECFF">#E8ECFF</color>
|
||||
<color name="color_2B2B2B">#2B2B2B</color>
|
||||
<color name="color_3376EA">#3376EA</color>
|
||||
<color name="color_2D3338">#2D3338</color>
|
||||
<color name="color_1D1F25">#1D1F25</color>
|
||||
<color name="color_cccccc">#CCCCCC</color>
|
||||
<color name="color_99000000">#99000000</color>
|
||||
<color name="color_CF8823">#CF8823</color>
|
||||
<color name="color_616CC1">#616CC1</color>
|
||||
<color name="color_666666">#666666</color>
|
||||
|
||||
<color name="blue_color_picker">#0066FF</color>
|
||||
<color name="brown_color_picker">#AF593E</color>
|
||||
<color name="green_color_picker">#01A368</color>
|
||||
<color name="orange_color_picker">#FF861F</color>
|
||||
<color name="red_color_picker">#ED0A3F</color>
|
||||
<color name="red_orange_color_picker">#FF3F34</color>
|
||||
<color name="sky_blue_color_picker">#76D7EA</color>
|
||||
<color name="violet_color_picker">#8359A3</color>
|
||||
<color name="yellow_color_picker">#FBE870</color>
|
||||
<color name="yellow_green_color_picker">#C5E17A</color>
|
||||
<color name="tool_bg">#151414</color>
|
||||
<color name="semi_black_transparent">#99000000</color>
|
||||
|
||||
<!-- 这2个颜色用来动态修改图片选择器的文件夹目录的背景颜色 e0adb 选中颜色 white 默认颜色-->
|
||||
<color name="picture_color_transparent_e0db">#F8F8F8</color>
|
||||
<color name="picture_color_transparent_white">#FFFFFF</color>
|
||||
|
||||
<!-- 这个颜色用来动态修改videoview的背景颜色-->
|
||||
<color name="video_bg_color">#F8F8F8</color>
|
||||
|
||||
<color name="default_bg">#F3F3F3</color>
|
||||
<color name="color_fe8b59">#FFFFFF</color>
|
||||
<color name="color_e83126">#E83126</color>
|
||||
<color name="color_e6000000">#e6000000</color>
|
||||
<color name="color_66ffffff">#66FFFFFF</color>
|
||||
<color name="color_search_2">#EEEEEE</color>
|
||||
<color name="color_search_1">#DDDDDD</color>
|
||||
|
||||
<color name="color_45000000">#45000000</color>
|
||||
|
||||
</resources>
|
||||
16
app/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Bkvideo" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
4
app/src/main/res/values-zh/values-zh.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="picture_completed">确定</string>
|
||||
</resources>
|
||||
77
app/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#000019</color>
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="colorPrimary">#E83126</color>
|
||||
<color name="color_2062D3">#2062D3</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="color_7B7888">#7B7888</color>
|
||||
<color name="color_8C8D92">#8C8D92</color>
|
||||
<color name="transparent">#00000000</color>
|
||||
<color name="color_222222">#222222</color>
|
||||
<color name="white11">#F4F6F8</color>
|
||||
<color name="color_24272E">#24272E</color>
|
||||
<color name="text_red">#DD493D</color>
|
||||
<color name="color_F5F3F8">#F5F3F8</color>
|
||||
<color name="color_FE6A9E">#FE6A9E</color>
|
||||
<color name="color_99FFFFFF">#99FFFFFF</color>
|
||||
<color name="color_993376EA">#993376EA</color>
|
||||
<color name="color_e1e3e6">#e1e3e6</color>
|
||||
<color name="gray_line_light">#eeeeee</color>
|
||||
<color name="color_AAAAAA">#AAAAAA</color>
|
||||
<color name="color_F8F8F8">#F8F8F8</color>
|
||||
<color name="color_333333">#333333</color>
|
||||
<color name="color_C4C4C4">#C4C4C4</color>
|
||||
<color name="color_999999">#66000000</color>
|
||||
<color name="color_F4F4F4">#F4F4F4</color>
|
||||
<color name="color_E7EAF9">#E7EAF9</color>
|
||||
<color name="color_777777">#777777</color>
|
||||
<color name="color_E8ECFF">#E8ECFF</color>
|
||||
<color name="color_2B2B2B">#2B2B2B</color>
|
||||
<color name="color_3376EA">#3376EA</color>
|
||||
<color name="color_2D3338">#2D3338</color>
|
||||
<color name="color_1D1F25">#1D1F25</color>
|
||||
<color name="color_cccccc">#CCCCCC</color>
|
||||
<color name="color_99000000">#99000000</color>
|
||||
<color name="color_CF8823">#CF8823</color>
|
||||
<color name="color_616CC1">#616CC1</color>
|
||||
<color name="color_666666">#666666</color>
|
||||
|
||||
<color name="blue_color_picker">#0066FF</color>
|
||||
<color name="brown_color_picker">#AF593E</color>
|
||||
<color name="green_color_picker">#01A368</color>
|
||||
<color name="orange_color_picker">#FF861F</color>
|
||||
<color name="red_color_picker">#ED0A3F</color>
|
||||
<color name="red_orange_color_picker">#FF3F34</color>
|
||||
<color name="sky_blue_color_picker">#76D7EA</color>
|
||||
<color name="violet_color_picker">#8359A3</color>
|
||||
<color name="yellow_color_picker">#FBE870</color>
|
||||
<color name="yellow_green_color_picker">#C5E17A</color>
|
||||
<color name="tool_bg">#151414</color>
|
||||
<color name="semi_black_transparent">#99000000</color>
|
||||
|
||||
<!-- 这2个颜色用来动态修改图片选择器的文件夹目录的背景颜色 e0adb 选中颜色 white 默认颜色-->
|
||||
<color name="picture_color_transparent_e0db">#F8F8F8</color>
|
||||
<color name="picture_color_transparent_white">#FFFFFF</color>
|
||||
|
||||
<!-- 这个颜色用来动态修改videoview的背景颜色-->
|
||||
<color name="video_bg_color">#F8F8F8</color>
|
||||
|
||||
<color name="default_bg">#F3F3F3</color>
|
||||
<color name="color_fe8b59">#FE8B59</color>
|
||||
<color name="color_e83126">#E83126</color>
|
||||
<color name="color_e6000000">#959595</color>
|
||||
<color name="color_66ffffff">#66FFFFFF</color>
|
||||
<color name="color_search_2">#EEEEEE</color>
|
||||
<color name="color_search_1">#DDDDDD</color>
|
||||
<color name="color_e12d48">#E12D48</color>
|
||||
|
||||
<color name="color_45000000">#45000000</color>
|
||||
|
||||
</resources>
|
||||
116
app/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,116 @@
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
|
||||
<!-- IntroActivity -->
|
||||
|
||||
<!-- sp -->
|
||||
<dimen name="sp10">10sp</dimen>
|
||||
<dimen name="sp11">11sp</dimen>
|
||||
<dimen name="sp12">12sp</dimen>
|
||||
<dimen name="sp13">13sp</dimen>
|
||||
<dimen name="sp14">14sp</dimen>
|
||||
<dimen name="sp15">15sp</dimen>
|
||||
<dimen name="sp16">16sp</dimen>
|
||||
<dimen name="sp17">17sp</dimen>
|
||||
<dimen name="sp18">18sp</dimen>
|
||||
<dimen name="sp19">19sp</dimen>
|
||||
<dimen name="sp20">20sp</dimen>
|
||||
<dimen name="sp22">22sp</dimen>
|
||||
<dimen name="sp25">25sp</dimen>
|
||||
<dimen name="sp36">36sp</dimen>
|
||||
<dimen name="sp38">38sp</dimen>
|
||||
|
||||
<!-- dp -->
|
||||
<dimen name="dp0">0dp</dimen>
|
||||
<dimen name="dp1">1dp</dimen>
|
||||
<dimen name="dp2">2dp</dimen>
|
||||
<dimen name="dp3">3dp</dimen>
|
||||
<dimen name="dp4">4dp</dimen>
|
||||
<dimen name="dp5">5dp</dimen>
|
||||
<dimen name="dp6">6dp</dimen>
|
||||
<dimen name="dp7">7dp</dimen>
|
||||
<dimen name="dp7_5">7.5dp</dimen>
|
||||
|
||||
<dimen name="dp8">8dp</dimen>
|
||||
<dimen name="dp10">10dp</dimen>
|
||||
<dimen name="dp11">11dp</dimen>
|
||||
|
||||
<dimen name="dp12">12dp</dimen>
|
||||
<dimen name="dp14">14dp</dimen>
|
||||
|
||||
<dimen name="dp15">15dp</dimen>
|
||||
<dimen name="dp16">16dp</dimen>
|
||||
<dimen name="dp18">18dp</dimen>
|
||||
<dimen name="dp20">20dp</dimen>
|
||||
<dimen name="dp22">22dp</dimen>
|
||||
<dimen name="dp24">24dp</dimen>
|
||||
|
||||
<dimen name="dp25">25dp</dimen>
|
||||
<dimen name="dp28">28dp</dimen>
|
||||
<dimen name="dp30">30dp</dimen>
|
||||
<dimen name="dp32">32dp</dimen>
|
||||
<dimen name="dp33">33dp</dimen>
|
||||
|
||||
<dimen name="dp35">35dp</dimen>
|
||||
<dimen name="dp36">36dp</dimen>
|
||||
<dimen name="dp38">38dp</dimen>
|
||||
<dimen name="dp40">40dp</dimen>
|
||||
<dimen name="dp42">42dp</dimen>
|
||||
<dimen name="dp44">44dp</dimen>
|
||||
<dimen name="dp45">45dp</dimen>
|
||||
<dimen name="dp48">48dp</dimen>
|
||||
<dimen name="dp50">50dp</dimen>
|
||||
<dimen name="dp_50">50dp</dimen>
|
||||
|
||||
<dimen name="dp52">52dp</dimen>
|
||||
<dimen name="dp55">55dp</dimen>
|
||||
<dimen name="dp60">60dp</dimen>
|
||||
<dimen name="dp65">65dp</dimen>
|
||||
<dimen name="dp68">68dp</dimen>
|
||||
|
||||
<dimen name="dp70">70dp</dimen>
|
||||
<dimen name="dp75">75dp</dimen>
|
||||
<dimen name="dp80">80dp</dimen>
|
||||
<dimen name="dp95">95dp</dimen>
|
||||
|
||||
<dimen name="dp_95">95dp</dimen>
|
||||
|
||||
<dimen name="dp90">90dp</dimen>
|
||||
<dimen name="dp100">100dp</dimen>
|
||||
<dimen name="dp102">102dp</dimen>
|
||||
|
||||
<dimen name="dp105">105dp</dimen>
|
||||
<dimen name="dp106">106dp</dimen>
|
||||
<dimen name="dp110">110dp</dimen>
|
||||
|
||||
<dimen name="dp120">120dp</dimen>
|
||||
<dimen name="dp130">130dp</dimen>
|
||||
<dimen name="dp_132">132dp</dimen>
|
||||
|
||||
|
||||
<dimen name="dp150">150dp</dimen>
|
||||
<dimen name="dp154">154dp</dimen>
|
||||
|
||||
<dimen name="dp160">160dp</dimen>
|
||||
<dimen name="dp175">175dp</dimen>
|
||||
<dimen name="dp180">180dp</dimen>
|
||||
<dimen name="dp193">193dp</dimen>
|
||||
|
||||
<dimen name="dp200">200dp</dimen>
|
||||
<dimen name="dp210">210dp</dimen>
|
||||
<dimen name="dp250">250dp</dimen>
|
||||
|
||||
|
||||
<dimen name="design_bottom_navigation_active_text_size">10sp</dimen>
|
||||
<dimen name="design_bottom_navigation_text_size">10sp</dimen>
|
||||
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<dimen name="editor_size">30dp</dimen>
|
||||
<dimen name="normal_margin">8dp</dimen>
|
||||
<dimen name="large_margin">16dp</dimen>
|
||||
<dimen name="top_tool_icon_width">50dp</dimen>
|
||||
|
||||
|
||||
</resources>
|
||||
17
app/src/main/res/values/font_certs.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<array name="com_google_android_gms_fonts_certs">
|
||||
<item>@array/com_google_android_gms_fonts_certs_dev</item>
|
||||
<item>@array/com_google_android_gms_fonts_certs_prod</item>
|
||||
</array>
|
||||
<string-array name="com_google_android_gms_fonts_certs_dev">
|
||||
<item>
|
||||
MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
|
||||
</item>
|
||||
</string-array>
|
||||
<string-array name="com_google_android_gms_fonts_certs_prod">
|
||||
<item>
|
||||
MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
|
||||
</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
11
app/src/main/res/values/ids.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item name="leftTime" type="id" />
|
||||
<item name="rightTime" type="id" />
|
||||
<item name="frameList" type="id" />
|
||||
|
||||
<item name="fullscreen_id" type="id" />
|
||||
|
||||
<item name="custom_full_id" type="id" />
|
||||
<item name="custom_small_id" type="id" />
|
||||
</resources>
|
||||
11
app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<resources>
|
||||
<string name="app_name">贷款</string>
|
||||
|
||||
<string name="file_permission_font_txt">文件权限已禁用</string>
|
||||
<string name="locat_permission_font_txt">定位权限已禁用</string>
|
||||
<string name="contacts_permission_font_txt">通讯录权限已禁用</string>
|
||||
|
||||
<string name="file_permission_font_all_txt">文件权限已禁用,请去设置中开启</string>
|
||||
<string name="locat_permission_font_all_txt">定位权限已禁用,请去设置中开启</string>
|
||||
<string name="contacts_permission_font_all_txt">通讯录权限已禁用,请去设置中开启</string>
|
||||
</resources>
|
||||
823
app/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,823 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Bkvideo" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
<style name="AppThemePlayer" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryDark">@color/purple_500</item>
|
||||
<item name="colorAccent">@color/purple_500</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
|
||||
<!-- <item name="android:forceDarkAllowed" tools:ignore="NewApi">true</item>-->
|
||||
|
||||
</style>
|
||||
|
||||
<style name="AppThemeStart" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryDark">@color/purple_500</item>
|
||||
<item name="colorAccent">@color/purple_500</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
|
||||
|
||||
<!-- <item name="android:forceDarkAllowed" tools:ignore="NewApi">true</item>-->
|
||||
|
||||
</style>
|
||||
|
||||
<style name="AppThemeLogin1" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryDark">@color/purple_500</item>
|
||||
<item name="colorAccent">@color/purple_500</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowActionBar">false</item>
|
||||
|
||||
<item name="android:windowLayoutInDisplayCutoutMode" tools:ignore="NewApi">shortEdges</item><!--控制刘海处显示信息-->
|
||||
</style>
|
||||
|
||||
|
||||
<style name="AppThemeLogin" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="colorPrimary">@color/black</item>
|
||||
<item name="colorPrimaryDark">@color/black</item>
|
||||
<item name="colorAccent">@color/black</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowDisablePreview">true</item>
|
||||
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
|
||||
<item name="background">@color/white</item>
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<style name="MaterialDesignDialog" parent="@style/Theme.AppCompat.Dialog">
|
||||
<!-- 背景透明 -->
|
||||
<item name="android:windowBackground">@drawable/dlg_input_video_bg</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<!-- 浮于Activity之上 -->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!-- 边框 -->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!-- Dialog以外的区域模糊效果 -->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<!-- 无标题 -->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!-- 半透明 -->
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowCloseOnTouchOutside">true</item>
|
||||
</style>
|
||||
|
||||
<style name="MaterialDesignDialog1" parent="@style/Theme.AppCompat.Dialog">
|
||||
<!-- 背景透明 -->
|
||||
<item name="android:windowBackground">@color/transparent</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<!-- 浮于Activity之上 -->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!-- 边框 -->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!-- Dialog以外的区域模糊效果 -->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<!-- 无标题 -->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!-- 半透明 -->
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowCloseOnTouchOutside">true</item>
|
||||
</style>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="dialog_style" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
</style>
|
||||
<!-- <style name="selectVideoTheme" parent="Base.Theme.NoActionBar">-->
|
||||
<!-- <!– Customize your theme here. –>-->
|
||||
<!-- <!–标题栏背景色–>-->
|
||||
<!-- <item name="colorPrimary">@color/white</item>-->
|
||||
<!-- <!–状态栏背景色–>-->
|
||||
<!-- <item name="colorPrimaryDark">@color/white</item>-->
|
||||
<!-- <!–是否改变图片列表界面状态栏字体颜色为黑色–>-->
|
||||
<!-- <item name="picture.statusFontColor">true</item>-->
|
||||
<!-- <!–返回键图标–>-->
|
||||
<!-- <item name="picture.leftBack.icon">@mipmap/ic_black_back</item>-->
|
||||
<!-- <!–标题下拉箭头–>-->
|
||||
<!-- <item name="picture.arrow_down.icon">@drawable/picture_icon_wechat_down</item>-->
|
||||
<!-- <!–标题上拉箭头–>-->
|
||||
<!-- <item name="picture.arrow_up.icon">@drawable/picture_icon_wechat_up</item>-->
|
||||
<!-- <!–标题文字颜色–>-->
|
||||
<!-- <item name="picture.title.textColor">@color/black</item>-->
|
||||
<!-- <!–标题栏右边文字–>-->
|
||||
<!-- <item name="picture.right.textColor">@color/black</item>-->
|
||||
<!-- <!–图片列表勾选样式–>-->
|
||||
<!-- <item name="picture.checked.style">@drawable/picture_wechat_num_selector</item>-->
|
||||
<!-- <!–开启图片列表勾选数字模式,开启的话勾选样式要换–>-->
|
||||
<!-- <item name="picture.style.checkNumMode">false</item>-->
|
||||
<!-- <!–选择图片样式0/9–>-->
|
||||
<!-- <item name="picture.style.numComplete">false</item>-->
|
||||
<!-- <!–图片列表底部背景色–>-->
|
||||
<!-- <item name="picture.bottom.bg">@color/white</item>-->
|
||||
<!-- <!–图片列表预览文字颜色–>-->
|
||||
<!-- <item name="picture.preview.textColor">@color/black</item>-->
|
||||
<!-- <!–图片列表已完成文字颜色–>-->
|
||||
<!-- <item name="picture.complete.textColor">@color/black</item>-->
|
||||
<!-- <!–图片已选数量圆点背景色–>-->
|
||||
<!-- <item name="picture.num.style">@drawable/picture_num_oval</item>-->
|
||||
<!-- <!–预览界面标题文字颜色–>-->
|
||||
<!-- <item name="picture.ac_preview.title.textColor">@color/black</item>-->
|
||||
<!-- <!–预览界面已完成文字颜色–>-->
|
||||
<!-- <item name="picture.ac_preview.complete.textColor">@color/black</item>-->
|
||||
<!-- <!–预览界面标题栏背景色–>-->
|
||||
<!-- <item name="picture.ac_preview.title.bg">@color/white</item>-->
|
||||
<!-- <!–预览界面底部背景色–>-->
|
||||
<!-- <item name="picture.ac_preview.bottom.bg">@color/white</item>-->
|
||||
<!-- <!–预览界面返回箭头–>-->
|
||||
<!-- <item name="picture.preview.leftBack.icon">@mipmap/ic_black_back</item>-->
|
||||
<!-- <!–裁剪页面标题背景色–>-->
|
||||
<!-- <item name="picture.crop.toolbar.bg">@color/white</item>-->
|
||||
<!-- <!–裁剪页面状态栏颜色–>-->
|
||||
<!-- <item name="picture.crop.status.color">@color/white</item>-->
|
||||
<!-- <!–裁剪页面标题文字颜色–>-->
|
||||
<!-- <item name="picture.crop.title.color">@color/black</item>-->
|
||||
<!-- <!–相册文件夹列表选中图标–>-->
|
||||
<!-- <item name="picture.folder_checked_dot">@drawable/picture_orange_oval</item>-->
|
||||
<!-- <!–原图勾选样式–>-->
|
||||
<!-- <item name="picture.original.check.style">@drawable/picture_original_wechat_checkbox</item>-->
|
||||
<!-- <!–原图字体颜色–>-->
|
||||
<!-- <item name="picture.original.text.color">@color/picture_color_white</item>-->
|
||||
<!-- <!–相册目录文件夹字体颜色–>-->
|
||||
<!-- <item name="picture.folder.textColor">@color/picture_color_4d</item>-->
|
||||
<!-- <!–相册目录文件夹字体大小–>-->
|
||||
<!-- <item name="picture.folder.textSize">16sp</item>-->
|
||||
<!-- <!–相册背景底色–>-->
|
||||
<!-- <item name="picture.container.backgroundColor">@color/white</item>-->
|
||||
<!-- <!–标题栏高度–>-->
|
||||
<!-- <item name="picture.titleBar.height">?actionBarSize</item>-->
|
||||
<!-- <!–标题栏右侧按钮方向箭头left Padding–>-->
|
||||
<!-- <item name="picture.titleRightArrow.LeftPadding">3dp</item>-->
|
||||
<!-- </style>-->
|
||||
|
||||
|
||||
<style name="ImportVideoDialog" parent="@style/Theme.AppCompat.Dialog">
|
||||
<item name="android:windowBackground">@drawable/dlg_input_video_bg</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowCloseOnTouchOutside">false</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="DialogTransparentTheme" parent="android:Theme.Holo.Dialog.NoActionBar">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="dialog" parent="Theme.AppCompat.Dialog">
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:backgroundDimEnabled">true</item><!--activity是否变暗-->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowIsTranslucent">false</item>
|
||||
<item name="android:windowDisablePreview">true</item>
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<declare-styleable name="VideoThumbnailView">
|
||||
<attr name="frameCount" format="integer" />
|
||||
<attr name="frameHeight" format="dimension|reference" />
|
||||
<attr name="coverColor" format="color|reference" />
|
||||
<attr name="pointerColor" format="color|reference" />
|
||||
<attr name="timeColor" format="color|reference" />
|
||||
<attr name="indicatorColor" format="color|reference" />
|
||||
<attr name="showTime" format="boolean" />
|
||||
<attr name="reset" format="boolean" />
|
||||
<attr name="overScrollDistance" format="dimension|reference" />
|
||||
<attr name="pointerStyle">
|
||||
<enum name="arrow" value="0" />
|
||||
<enum name="simple" value="1" />
|
||||
<enum name="simple2" value="2" />
|
||||
<enum name="circle" value="3" />
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="NiceImageView">
|
||||
<attr name="is_circle" format="boolean" />
|
||||
<attr name="is_cover_src" format="boolean" />
|
||||
<attr name="corner_radius" format="dimension" />n
|
||||
<attr name="corner_top_left_radius" format="dimension" />
|
||||
<attr name="corner_top_right_radius" format="dimension" />
|
||||
<attr name="corner_bottom_left_radius" format="dimension" />
|
||||
<attr name="corner_bottom_right_radius" format="dimension" />
|
||||
<attr name="border_width" format="dimension" />
|
||||
<attr name="border_color" format="color" />
|
||||
<attr name="inner_border_width" format="dimension" />
|
||||
<attr name="inner_border_color" format="color" />
|
||||
<attr name="mask_color" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="IMGColorRadio">
|
||||
|
||||
<attr name="image_color" format="color" />
|
||||
<attr name="image_stroke_color" format="color" />
|
||||
|
||||
</declare-styleable>
|
||||
|
||||
<!--涟漪控件属性-->
|
||||
<declare-styleable name="mRippleView">
|
||||
<attr name="cColor" format="color"/>
|
||||
<attr name="cSpeed" format="integer"/>
|
||||
<attr name="cDensity" format="integer"/>
|
||||
<attr name="cIsFill" format="boolean"/>
|
||||
<attr name="cIsAlpha" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="custume_ripple_imageview">
|
||||
<attr name="show_spacing_time" format="integer"></attr>
|
||||
<attr name="imageViewWidth" format="dimension"></attr>
|
||||
<attr name="imageViewHeigth" format="dimension"></attr>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="CircleImageView">
|
||||
<attr name="ease_border_color" format="color" />
|
||||
<attr name="ease_border_width" format="dimension" />
|
||||
<attr name="ease_press_alpha" format="integer" />
|
||||
<attr name="ease_press_color" format="color" />
|
||||
<attr name="ease_radius" format="dimension" />
|
||||
<attr name="es_shape_type" format="enum">
|
||||
<enum name="none" value="0" />
|
||||
<enum name="round" value="1" />
|
||||
<enum name="rectangle" value="2" />
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="IndicatorView">
|
||||
|
||||
<attr name="vpi_slider_checked_color" format="color" />
|
||||
<attr name="vpi_slider_normal_color" format="color" />
|
||||
<attr name="vpi_slider_radius" format="dimension" />
|
||||
<attr name="vpi_rtl" format="boolean" />
|
||||
|
||||
<attr name="vpi_orientation" format="enum">
|
||||
<enum name="horizontal" value="0" />
|
||||
<enum name="vertical" value="1" />
|
||||
<enum name="rtl" value="3"/>
|
||||
</attr>
|
||||
|
||||
<attr name="vpi_slide_mode" format="enum">
|
||||
<enum name="normal" value="0" />
|
||||
<enum name="smooth" value="2" />
|
||||
<enum name="worm" value="3" />
|
||||
<enum name="scale" value="4" />
|
||||
<enum name="color" value="5" />
|
||||
</attr>
|
||||
|
||||
<attr name="vpi_style" format="enum">
|
||||
<enum name="circle" value="0" />
|
||||
<enum name="dash" value="2" />
|
||||
<enum name="round_rect" value="4" />
|
||||
</attr>
|
||||
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="ShimmerFrameLayout">
|
||||
<attr name="shimmer_clip_to_children" format="boolean"/>
|
||||
<attr name="shimmer_colored" format="boolean"/>
|
||||
<attr name="shimmer_base_color" format="color"/>
|
||||
<attr name="shimmer_highlight_color" format="color"/>
|
||||
<attr name="shimmer_base_alpha" format="float"/>
|
||||
<attr name="shimmer_highlight_alpha" format="float"/>
|
||||
<attr name="shimmer_auto_start" format="boolean"/>
|
||||
<attr name="shimmer_duration" format="integer"/>
|
||||
<attr name="shimmer_repeat_count" format="integer"/>
|
||||
<attr name="shimmer_repeat_delay" format="integer"/>
|
||||
<attr name="shimmer_repeat_mode" format="enum">
|
||||
<enum name="restart" value="1"/>
|
||||
<enum name="reverse" value="2"/>
|
||||
</attr>
|
||||
<attr name="shimmer_start_delay" format="integer"/>
|
||||
<attr name="shimmer_direction" format="enum">
|
||||
<enum name="left_to_right" value="0"/>
|
||||
<enum name="top_to_bottom" value="1"/>
|
||||
<enum name="right_to_left" value="2"/>
|
||||
<enum name="bottom_to_top" value="3"/>
|
||||
</attr>
|
||||
<attr name="shimmer_dropoff" format="float"/>
|
||||
<attr name="shimmer_fixed_width" format="dimension"/>
|
||||
<attr name="shimmer_fixed_height" format="dimension"/>
|
||||
<attr name="shimmer_intensity" format="float"/>
|
||||
<attr name="shimmer_width_ratio" format="float"/>
|
||||
<attr name="shimmer_height_ratio" format="float"/>
|
||||
<attr name="shimmer_shape" format="enum">
|
||||
<enum name="linear" value="0"/>
|
||||
<enum name="radial" value="1"/>
|
||||
</attr>
|
||||
<attr name="shimmer_tilt" format="float"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PageGridView">
|
||||
<!--每页大小-->
|
||||
<attr name="pageSize" format="integer|reference" />
|
||||
<!--是否显示指示点-->
|
||||
<attr name="isShowIndicator" format="boolean" />
|
||||
<!--选中指示点-->
|
||||
<attr name="selectedIndicator" format="reference" />
|
||||
<!--未选中指示点-->
|
||||
<attr name="unSelectedIndicator" format="reference" />
|
||||
<!--指示器位置-->
|
||||
<attr name="indicatorGravity" format="enum">
|
||||
<enum name="left" value="0" />
|
||||
<enum name="center" value="1" />
|
||||
<enum name="right" value="2" />
|
||||
</attr>
|
||||
<!--指示器左内边距-->
|
||||
<attr name="indicatorPaddingLeft" format="dimension" />
|
||||
<!--指示器右内边距-->
|
||||
<attr name="indicatorPaddingRight" format="dimension" />
|
||||
<!--指示器上内边距-->
|
||||
<attr name="indicatorPaddingTop" format="dimension" />
|
||||
<!--指示器下内边距-->
|
||||
<attr name="indicatorPaddingBottom" format="dimension" />
|
||||
<!--指示器内边距-->
|
||||
<attr name="indicatorPadding" format="dimension" />
|
||||
<!--指示器背景颜色-->
|
||||
<attr name="indicatorBackground" format="color" />
|
||||
|
||||
<!--ViewPager背景资源-->
|
||||
<attr name="vpBackground" format="reference|color" />
|
||||
|
||||
<!--ViewPager 内边距-->
|
||||
<attr name="vpPadding" format="dimension" />
|
||||
<!--列数-->
|
||||
<attr name="numColumns" format="integer|reference" />
|
||||
<!--Item布局-->
|
||||
<attr name="itemView" format="reference" />
|
||||
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TrinityTabLayout">
|
||||
<attr name="tabIndicatorColor" format="color"/>
|
||||
<attr name="tabIndicatorHeight" format="dimension"/>
|
||||
<attr name="tabContentStart" format="dimension"/>
|
||||
<attr name="tabBackground" format="reference"/>
|
||||
<attr name="tabIndicator" format="reference"/>
|
||||
<attr name="trinityTabIndicatorGravity">
|
||||
<enum name="bottom" value="0"/>
|
||||
<enum name="center" value="1"/>
|
||||
<enum name="top" value="2"/>
|
||||
<enum name="stretch" value="3"/>
|
||||
</attr>
|
||||
<attr name="tabIndicatorAnimationDuration" format="integer"/>
|
||||
<attr name="tabIndicatorFullWidth" format="boolean"/>
|
||||
<attr name="trinityTabMode">
|
||||
<enum name="scrollable" value="0"/>
|
||||
<enum name="fixed" value="1"/>
|
||||
<enum name="auto" value="2"/>
|
||||
</attr>
|
||||
<attr name="trinityTabGravity">
|
||||
<enum name="fill" value="0"/>
|
||||
<enum name="center" value="1"/>
|
||||
</attr>
|
||||
<attr name="tabInlineLabel" format="boolean"/>
|
||||
<attr name="tabMinWidth" format="dimension"/>
|
||||
<attr name="tabMaxWidth" format="dimension"/>
|
||||
<attr name="tabTextAppearance" format="reference"/>
|
||||
<attr name="tabTextColor" format="color"/>
|
||||
<attr name="tabSelectedTextColor" format="color"/>
|
||||
<attr name="tabPaddingStart" format="dimension"/>
|
||||
<attr name="tabPaddingTop" format="dimension"/>
|
||||
<attr name="tabPaddingEnd" format="dimension"/>
|
||||
<attr name="tabPaddingBottom" format="dimension"/>
|
||||
<attr name="tabPadding" format="dimension"/>
|
||||
<attr name="tabIconTint" format="color"/>
|
||||
<attr name="trinityTabIconTintMode">
|
||||
<enum name="src_over" value="3"/>
|
||||
<enum name="src_in" value="5"/>
|
||||
<enum name="src_atop" value="9"/>
|
||||
<enum name="multiply" value="14"/>
|
||||
<enum name="screen" value="15"/>
|
||||
<enum name="add" value="16"/>
|
||||
</attr>
|
||||
<attr name="tabRippleColor" format="color"/>
|
||||
<attr name="tabUnboundedRipple" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TrinityTabItem">
|
||||
<attr name="android:text"/>
|
||||
<attr name="android:icon"/>
|
||||
<attr name="android:layout"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="DYLoadingView">
|
||||
<attr name="radius1" format="dimension" />
|
||||
<attr name="radius2" format="dimension" />
|
||||
<attr name="rtlScale" format="float" />
|
||||
<attr name="ltrScale" format="float" />
|
||||
<attr name="color1" format="color" />
|
||||
<attr name="color2" format="color" />
|
||||
<attr name="mixColor" format="color" />
|
||||
<attr name="duration" format="integer" />
|
||||
<attr name="pauseDuration" format="integer" />
|
||||
<attr name="gap" format="dimension" />
|
||||
<attr name="scaleStartFraction" format="float" />
|
||||
<attr name="scaleEndFraction" format="float" />
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<!-- indicator -->
|
||||
<!-- 设置显示器颜色 -->
|
||||
<attr name="tl_indicator_color" format="color"/>
|
||||
<!-- 设置显示器高度 -->
|
||||
<attr name="tl_indicator_height" format="dimension"/>
|
||||
<!-- 设置显示器固定宽度 -->
|
||||
<attr name="tl_indicator_width" format="dimension"/>
|
||||
<!-- 设置显示器margin,当indicator_width大于0,无效 -->
|
||||
<attr name="tl_indicator_margin_left" format="dimension"/>
|
||||
<attr name="tl_indicator_margin_top" format="dimension"/>
|
||||
<attr name="tl_indicator_margin_right" format="dimension"/>
|
||||
<attr name="tl_indicator_margin_bottom" format="dimension"/>
|
||||
<!-- 设置显示器圆角弧度-->
|
||||
<attr name="tl_indicator_corner_radius" format="dimension"/>
|
||||
<!-- 设置显示器上方还是下方,只对圆角矩形有用-->
|
||||
<attr name="tl_indicator_gravity" format="enum">
|
||||
<enum name="TOP" value="48"/>
|
||||
<enum name="BOTTOM" value="80"/>
|
||||
</attr>
|
||||
<!-- 设置显示器为常规|三角形|背景色块|-->
|
||||
<attr name="tl_indicator_style" format="enum">
|
||||
<enum name="NORMAL" value="0"/>
|
||||
<enum name="TRIANGLE" value="1"/>
|
||||
<enum name="BLOCK" value="2"/>
|
||||
</attr>
|
||||
<!-- 设置显示器长度与title一样长,只有在STYLE_NORMAL并且indicatorWidth小于零有效-->
|
||||
<attr name="tl_indicator_width_equal_title" format="boolean"/>
|
||||
<!-- 设置显示器支持动画-->
|
||||
<attr name="tl_indicator_anim_enable" format="boolean"/>
|
||||
<!-- 设置显示器动画时间-->
|
||||
<attr name="tl_indicator_anim_duration" format="integer"/>
|
||||
<!-- 设置显示器支持动画回弹效果-->
|
||||
<attr name="tl_indicator_bounce_enable" format="boolean"/>
|
||||
|
||||
<!-- underline -->
|
||||
<!-- 设置下划线颜色 -->
|
||||
<attr name="tl_underline_color" format="color"/>
|
||||
<!-- 设置下划线高度 -->
|
||||
<attr name="tl_underline_height" format="dimension"/>
|
||||
<!-- 设置下划线上方还是下方-->
|
||||
<attr name="tl_underline_gravity" format="enum">
|
||||
<enum name="TOP" value="48"/>
|
||||
<enum name="BOTTOM" value="80"/>
|
||||
</attr>
|
||||
|
||||
<!-- divider -->
|
||||
<!-- 设置分割线颜色 -->
|
||||
<attr name="tl_divider_color" format="color"/>
|
||||
<!-- 设置分割线宽度 -->
|
||||
<attr name="tl_divider_width" format="dimension"/>
|
||||
<!-- 设置分割线的paddingTop和paddingBottom -->
|
||||
<attr name="tl_divider_padding" format="dimension"/>
|
||||
|
||||
<!-- tab -->
|
||||
<!-- 设置tab的paddingLeft和paddingRight -->
|
||||
<attr name="tl_tab_padding" format="dimension"/>
|
||||
<!-- 设置tab大小等分 -->
|
||||
<attr name="tl_tab_space_equal" format="boolean"/>
|
||||
<!-- 设置tab固定大小 -->
|
||||
<attr name="tl_tab_width" format="dimension"/>
|
||||
|
||||
<!-- title -->
|
||||
<!-- 设置字体大小 -->
|
||||
<attr name="tl_textsize" format="dimension"/>
|
||||
<!-- 设置字体选中颜色 -->
|
||||
<attr name="tl_textSelectColor" format="color"/>
|
||||
<!-- 设置字体未选中颜色 -->
|
||||
<attr name="tl_textUnselectColor" format="color"/>
|
||||
<!-- 设置字体加粗 -->
|
||||
<attr name="tl_textBold" format="boolean"/>
|
||||
<!-- 设置字体全大写 -->
|
||||
<attr name="tl_textAllCaps" format="boolean"/>
|
||||
|
||||
<!-- 设置字体大小 -->
|
||||
<attr name="tl_subtextsize" format="dimension" />
|
||||
<!-- 设置字体选中颜色 -->
|
||||
<attr name="tl_subtextSelectColor" format="color" />
|
||||
<!-- 设置字体未选中颜色 -->
|
||||
<attr name="tl_subtextUnselectColor" format="color" />
|
||||
<!-- 设置字体加粗 -->
|
||||
<attr name="tl_subtextBold" format="boolean" />
|
||||
<!-- 设置字体全大写 -->
|
||||
<attr name="tl_subtextAllCaps" format="boolean" />
|
||||
|
||||
<declare-styleable name="CommonTabLayout">
|
||||
<!-- indicator -->
|
||||
<attr name="tl_indicator_color"/>
|
||||
<attr name="tl_indicator_height"/>
|
||||
<attr name="tl_indicator_width"/>
|
||||
<attr name="tl_indicator_margin_left"/>
|
||||
<attr name="tl_indicator_margin_top"/>
|
||||
<attr name="tl_indicator_margin_right"/>
|
||||
<attr name="tl_indicator_margin_bottom"/>
|
||||
<attr name="tl_indicator_corner_radius"/>
|
||||
<attr name="tl_indicator_gravity"/>
|
||||
<attr name="tl_indicator_style"/>
|
||||
<attr name="tl_indicator_anim_enable"/>
|
||||
<attr name="tl_indicator_anim_duration"/>
|
||||
<attr name="tl_indicator_bounce_enable"/>
|
||||
|
||||
<!-- underline -->
|
||||
<attr name="tl_underline_color"/>
|
||||
<attr name="tl_underline_height"/>
|
||||
<attr name="tl_underline_gravity"/>
|
||||
|
||||
<!-- divider -->
|
||||
<attr name="tl_divider_color"/>
|
||||
<attr name="tl_divider_width"/>
|
||||
<attr name="tl_divider_padding"/>
|
||||
|
||||
<!-- tab -->
|
||||
<attr name="tl_tab_padding"/>
|
||||
<attr name="tl_tab_space_equal"/>
|
||||
<attr name="tl_tab_width"/>
|
||||
|
||||
<!-- title -->
|
||||
<attr name="tl_textsize"/>
|
||||
<attr name="tl_textSelectColor"/>
|
||||
<attr name="tl_textUnselectColor"/>
|
||||
<attr name="tl_textBold"/>
|
||||
<attr name="tl_textAllCaps"/>
|
||||
|
||||
<!-- subtitle -->
|
||||
<attr name="tl_subtextsize" />
|
||||
<attr name="tl_subtextSelectColor" />
|
||||
<attr name="tl_subtextUnselectColor" />
|
||||
<attr name="tl_subtextBold" />
|
||||
<attr name="tl_subtextAllCaps" />
|
||||
|
||||
<!-- icon -->
|
||||
<!-- 设置icon宽度 -->
|
||||
<attr name="tl_iconWidth" format="dimension"/>
|
||||
<!-- 设置icon高度 -->
|
||||
<attr name="tl_iconHeight" format="dimension"/>
|
||||
<!-- 设置icon是否可见 -->
|
||||
<attr name="tl_iconVisible" format="boolean"/>
|
||||
<!-- 设置icon显示位置,对应Gravity中常量值 -->
|
||||
<attr name="tl_iconGravity" format="enum">
|
||||
<enum name="LEFT" value="3"/>
|
||||
<enum name="TOP" value="48"/>
|
||||
<enum name="RIGHT" value="5"/>
|
||||
<enum name="BOTTOM" value="80"/>
|
||||
</attr>
|
||||
<!-- 设置icon与文字间距 -->
|
||||
<attr name="tl_iconMargin" format="dimension"/>
|
||||
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="MsgView">
|
||||
<!-- 圆角矩形背景色 -->
|
||||
<attr name="mv_backgroundColor" format="color"/>
|
||||
<!-- 圆角弧度,单位dp-->
|
||||
<attr name="mv_cornerRadius" format="dimension"/>
|
||||
<!-- 圆角弧度,单位dp-->
|
||||
<attr name="mv_strokeWidth" format="dimension"/>
|
||||
<!-- 圆角边框颜色-->
|
||||
<attr name="mv_strokeColor" format="color"/>
|
||||
<!-- 圆角弧度是高度一半-->
|
||||
<attr name="mv_isRadiusHalfHeight" format="boolean"/>
|
||||
<!-- 圆角矩形宽高相等,取较宽高中大值-->
|
||||
<attr name="mv_isWidthHeightEqual" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<!-- 自定义验证码输入框-->
|
||||
<declare-styleable name="vericationCodeView">
|
||||
<!--输入框的数量-->
|
||||
<attr name="vcv_et_number" format="integer" />
|
||||
<!--输入类型-->
|
||||
<attr name="vcv_et_inputType">
|
||||
<enum name="number" value="0" />
|
||||
<enum name="numberPassword" value="1" />
|
||||
<enum name="text" value="2" />
|
||||
<enum name="textPassword" value="3" />
|
||||
</attr>
|
||||
<!--输入框的宽度-->
|
||||
<attr name="vcv_et_width" format="dimension|reference" />
|
||||
<!--输入框文字颜色-->
|
||||
<attr name="vcv_et_text_color" format="color|reference" />
|
||||
<!--输入框文字大小-->
|
||||
<attr name="vcv_et_text_size" format="dimension|reference" />
|
||||
<!--输入框背景-->
|
||||
<attr name="vcv_et_bg" format="reference" />
|
||||
<!--光标样式-->
|
||||
<attr name="vcv_et_cursor" format="reference" />
|
||||
<!--是否隐藏光标-->
|
||||
<attr name="vcv_et_cursor_visible" format="boolean" />
|
||||
<!--输入框间距,不输入则代表平分-->
|
||||
<attr name="vcv_et_spacing" format="dimension|reference" />
|
||||
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="AutoLinkTextView">
|
||||
<!-- 链接高亮颜色 -->
|
||||
<attr name="highlight_textcolor" format="color" />
|
||||
<!-- 默认文字颜色 -->
|
||||
<attr name="default_textcolor" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TiktokLoadingView">
|
||||
<!--进度条初始颜色-->
|
||||
<attr name="progressColor" format="string"></attr>
|
||||
<!--进度条最小宽度即初始宽度-->
|
||||
<attr name="minProgressWidth" format="dimension"></attr>
|
||||
<!--view最小宽度-->
|
||||
<attr name="minWidth" format="dimension"></attr>
|
||||
<!--view最小高度-->
|
||||
<attr name="minHeight" format="dimension"></attr>
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<declare-styleable name="wheelSurfView">
|
||||
<!--类型 根据类型来加载资源 1 默认类型 用户需要提供文字和图片 2 暴力模式 用户只需要提供一张圆形的用来旋转的图片-->
|
||||
<attr name="type" format="integer"/>
|
||||
<!--最低圈数 默认值3 也就是说每次旋转都会最少转3圈-->
|
||||
<attr name="minTimes" format="integer"/>
|
||||
<!--扇形的数量 也就是奖品的份数-->
|
||||
<attr name="typenum" format="integer"/>
|
||||
<!--每一个扇形旋转消耗的时间-->
|
||||
<attr name="vartime" format="integer"/>
|
||||
<!--类型为1的时候 需要提供每个扇形上面的文字描述 长度必须和typenum一致-->
|
||||
<attr name="deses" format="reference"/>
|
||||
<!--类型为1的时候 需要提供每个扇形上面的图片展示 长度必须和typenum一致-->
|
||||
<attr name="icons" format="reference"/>
|
||||
<!--类型为1的时候 需要提供每个扇形背景颜色 长度必须和typenum一致-->
|
||||
<attr name="colors" format="reference"/>
|
||||
<!--中间图片的引用 有默认值 不填则使用默认值-->
|
||||
<attr name="goImg" format="reference"/>
|
||||
<!--圆环的图片引用 有默认值 不填则使用默认值-->
|
||||
<attr name="huanImg" format="reference"/>
|
||||
<!--如果类型为2 此值必填-->
|
||||
<attr name="mainImg" format="reference"/>
|
||||
<!--文字大小-->
|
||||
<attr name="textSize" format="dimension"/>
|
||||
<!--文字颜色-->
|
||||
<attr name="textColor" format="reference|color"/>
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<style name="MyBgTablayoutstyle" parent="Base.Widget.Design.TabLayout">
|
||||
|
||||
<item name="android:textSize">@dimen/sp16</item>
|
||||
</style>
|
||||
|
||||
<style name="TabLayoutTextSize">
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">@dimen/sp16</item>
|
||||
</style>
|
||||
|
||||
<style name="TabLayoutTextSize_two">
|
||||
<item name="android:textSize">@dimen/sp16</item>
|
||||
<item name="android:textStyle">normal</item>
|
||||
</style>
|
||||
|
||||
<style name="TabLayoutTextSize1">
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">@dimen/sp18</item>
|
||||
</style>
|
||||
|
||||
<style name="TabLayoutTextSize_two1">
|
||||
<item name="android:textSize">@dimen/sp16</item>
|
||||
<item name="android:textStyle">normal</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="CircularProgressView">
|
||||
<attr name="backWidth" format="dimension" /> <!--背景圆环宽度-->
|
||||
<attr name="progWidth" format="dimension" /> <!--进度圆环宽度-->
|
||||
<attr name="backColor" format="color" /> <!--背景圆环颜色-->
|
||||
<attr name="progColor" format="color" /> <!--进度圆环颜色-->
|
||||
<attr name="progStartColor" format="color" /> <!--进度圆环开始颜色-->
|
||||
<attr name="progFirstColor" format="color" /> <!--进度圆环结束颜色-->
|
||||
<attr name="progress" format="integer" /> <!--圆环进度-->
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<attr name="popupTextAlignment" format="enum">
|
||||
<enum name="start" value="0" />
|
||||
<enum name="end" value="1" />
|
||||
<enum name="center" value="2" />
|
||||
</attr>
|
||||
|
||||
<declare-styleable name="NiceSpinner">
|
||||
<attr name="arrowTint" format="color" />
|
||||
<attr name="hideArrow" format="boolean" />
|
||||
<attr name="arrowDrawable" format="reference|color" />
|
||||
<attr name="dropDownListPaddingBottom" format="dimension" />
|
||||
<attr name="backgroundSelector" format="integer" />
|
||||
<attr name="textTint" format="color" />
|
||||
<attr name="popupTextAlignment" />
|
||||
<attr name="entries" format="reference" />
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<declare-styleable name="CircleProgressbar">
|
||||
<attr name="radius" format="dimension" />
|
||||
<attr name="strokeWidth" format="dimension" />
|
||||
<attr name="ringColor" format="color" />
|
||||
<attr name="ringColor1" format="color" />
|
||||
|
||||
<attr name="textColorNew" format="color" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="BannerViewPager">
|
||||
<!--页面切换时间间隔-->
|
||||
<attr format="integer" name="bvp_interval" />
|
||||
<attr format="integer" name="bvp_scroll_duration" />
|
||||
<attr format="boolean" name="bvp_can_loop" />
|
||||
<attr format="boolean" name="bvp_auto_play" />
|
||||
<attr format="color" name="bvp_indicator_checked_color" />
|
||||
<attr format="color" name="bvp_indicator_normal_color" />
|
||||
<attr format="dimension" name="bvp_indicator_radius" />
|
||||
<attr format="dimension" name="bvp_round_corner" />
|
||||
<attr format="dimension" name="bvp_page_margin" />
|
||||
<attr format="dimension" name="bvp_reveal_width" />
|
||||
<attr format="enum" name="bvp_indicator_style">
|
||||
<enum name="circle" value="0" />
|
||||
<enum name="dash" value="2" />
|
||||
<enum name="round_rect" value="4" />
|
||||
</attr>
|
||||
<attr format="enum" name="bvp_indicator_slide_mode">
|
||||
<enum name="normal" value="0" />
|
||||
<enum name="smooth" value="2" />
|
||||
<enum name="worm" value="3" />
|
||||
<enum name="scale" value="4" />
|
||||
<enum name="color" value="5" />
|
||||
</attr>
|
||||
<attr format="enum" name="bvp_indicator_gravity">
|
||||
<enum name="center" value="0" />
|
||||
<enum name="start" value="2" />
|
||||
<enum name="end" value="4" />
|
||||
</attr>
|
||||
<attr format="enum" name="bvp_page_style">
|
||||
<enum name="normal" value="0" />
|
||||
<enum name="multi_page" value="2" />
|
||||
<enum name="multi_page_overlap" value="4" />
|
||||
<enum name="multi_page_scale" value="8" />
|
||||
</attr>
|
||||
<attr format="enum" name="bvp_indicator_visibility">
|
||||
<enum name="visible" value="0" />
|
||||
<enum name="invisible" value="4" />
|
||||
<enum name="gone" value="8" />/>
|
||||
</attr>
|
||||
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
</resources>
|
||||
9
app/src/main/res/xml/file_paths.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-path
|
||||
name="external_storage_root"
|
||||
path="." />
|
||||
<root-path name="root_path" path="."/>
|
||||
<external-files-path name="external_files_path" path = "."/>
|
||||
<external-files-path name="opensdk_external" path="Images/tmp"/>
|
||||
<external-files-path name="umeng_cache" path="umeng_cache/"/>
|
||||
</paths>
|
||||
9
app/src/main/res/xml/file_paths_csj.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--为了适配所有路径可以设置 path = "." -->
|
||||
<external-path name="tt_external_root" path="." />
|
||||
<external-path name="tt_external_download" path="Download" />
|
||||
<external-files-path name="tt_external_files_download" path="Download" />
|
||||
<files-path name="tt_internal_file_download" path="Download" />
|
||||
<cache-path name="tt_internal_cache_download" path="Download" />
|
||||
</paths>
|
||||
10
app/src/main/res/xml/gdt_file_path.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<!-- 这个下载路径也不可以修改,必须为GDTDOWNLOAD -->
|
||||
<external-cache-path
|
||||
name="gdt_sdk_download_path1"
|
||||
path="com_qq_e_download" />
|
||||
<cache-path
|
||||
name="gdt_sdk_download_path2"
|
||||
path="com_qq_e_download" />
|
||||
</paths>
|
||||
4
app/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
17
app/src/test/java/com/bikao/cleanmark/ExampleUnitTest.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.bikao.cleanmark;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||