拷贝APP_Bck20250119项目源码,移除libjc/jcc/libs/android-29.jar文件。

This commit is contained in:
ZhanGSKen
2025-01-19 19:59:04 +08:00
commit 65509eacba
654 changed files with 35062 additions and 0 deletions

1
libaes/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

48
libaes/build.gradle Normal file
View File

@@ -0,0 +1,48 @@
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply from: '../.winboll/winboll_lib_build.gradle'
apply from: '../.winboll/winboll_lint_build.gradle'
android {
namespace 'cc.winboll.studio.libaes'
compileSdkVersion 32
buildToolsVersion "33.0.3"
defaultConfig {
minSdkVersion 24
targetSdkVersion 30
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
dependencies {
//api 'cc.winboll.studio:winboll-shared:1.6.5'
api 'io.github.medyo:android-about-page:2.0.0'
api 'com.github.getActivity:ToastUtils:10.5'
api 'com.jcraft:jsch:0.1.55'
api 'org.jsoup:jsoup:1.13.1'
api 'com.squareup.okhttp3:okhttp:4.4.1'
api 'androidx.appcompat:appcompat:1.0.0'
api 'androidx.fragment:fragment:1.0.0'
api 'com.google.android.material:material:1.0.0'
// https://github.com/baoyongzhang/android-PullRefreshLayout
api 'com.baoyz.pullrefreshlayout:library:1.2.0'
api 'cc.winboll.studio:libapputils:9.2.1'
api 'cc.winboll.studio:libappbase:1.0.3'
api fileTree(dir: 'libs', include: ['*.jar'])
}

8
libaes/build.properties Normal file
View File

@@ -0,0 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Sun Jan 19 04:58:59 GMT 2025
stageCount=3
libraryProject=libaes
baseVersion=7.6
publishVersion=7.6.2
buildCount=4
baseBetaVersion=7.6.3

Binary file not shown.

17
libaes/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:/tools/adt-bundle-windows-x86_64-20131030/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

View File

@@ -0,0 +1,20 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="cc.winboll.studio.libaes">
<application>
<activity android:name="cc.winboll.studio.libaes.unittests.SecondaryLibraryActivity"/>
<activity android:name="cc.winboll.studio.libaes.activitys.AboutActivity"/>
<activity android:name="cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity"/>
<activity android:name="cc.winboll.studio.libaes.unittests.TestAToolbarActivity"/>
<activity android:name="cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity"/>
</application>
</manifest>

View File

@@ -0,0 +1,207 @@
package cc.winboll.studio.libaes;
import android.content.Context;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
public abstract class DrawerMenuDataAdapter<T> extends BaseAdapter {
private ArrayList<T> mData;
private int mLayoutResource; //布局id
public DrawerMenuDataAdapter() {
}
public DrawerMenuDataAdapter(ArrayList<T> mData, int mLayoutRes) {
this.mData = mData;
this.mLayoutResource = mLayoutRes;
}
@Override
public int getCount() {
return mData != null ? mData.size() : 0;
}
@Override
public T getItem(int position) {
return mData.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = ViewHolder.bind(parent.getContext(), convertView, parent, mLayoutResource
, position);
bindView(viewHolder, getItem(position));
return viewHolder.getItemView();
}
public abstract void bindView(ViewHolder holder, T obj);
// 添加数据项
//
public void add(T item) {
if (mData == null) {
mData = new ArrayList<>();
}
mData.add(item);
notifyDataSetChanged();
}
// 添加数据项在指定位置
//
public void add(int position, T item) {
if (mData == null) {
mData = new ArrayList<>();
}
mData.add(position, item);
notifyDataSetChanged();
}
// 删除数据项
//
public void remove(T item) {
if (mData != null) {
mData.remove(item);
}
notifyDataSetChanged();
}
// 删除指定位置数据项
//
public void remove(int position) {
if (mData != null) {
mData.remove(position);
}
notifyDataSetChanged();
}
// 清理所有数据项
//
public void clear() {
if (mData != null) {
mData.clear();
}
notifyDataSetChanged();
}
public static class ViewHolder {
// 存储在 ListView 的 item 中的 View
SparseArray<View> mSparseArrayView;
// 存放convertView
View mViewItem;
// 游标
int mnPosition;
Context mContext;
//构造方法
//
private ViewHolder(Context context, ViewGroup parent, int layoutResource) {
mSparseArrayView = new SparseArray<>();
this.mContext = context;
View convertView = LayoutInflater.from(context).inflate(layoutResource, parent, false);
convertView.setTag(this);
mViewItem = convertView;
}
//绑定 ViewHolder 与数据项
//
public static ViewHolder bind(Context context, View convertView, ViewGroup parent,
int layoutResource, int position) {
ViewHolder viewHolder;
if (convertView == null) {
viewHolder = new ViewHolder(context, parent, layoutResource);
} else {
viewHolder = (ViewHolder) convertView.getTag();
viewHolder.mViewItem = convertView;
}
viewHolder.mnPosition = position;
return viewHolder;
}
@SuppressWarnings("unchecked")
public <T extends View> T getView(int id) {
T t = (T) mSparseArrayView.get(id);
if (t == null) {
t = (T) mViewItem.findViewById(id);
mSparseArrayView.put(id, t);
}
return t;
}
// 获取当前条目
//
public View getItemView() {
return mViewItem;
}
// 获取条目位置
//
public int getItemPosition() {
return mnPosition;
}
// 设置文字
//
public ViewHolder setText(int id, CharSequence text) {
View view = getView(id);
if (view instanceof TextView) {
((TextView) view).setText(text);
}
return this;
}
// 设置图片
//
public ViewHolder setImageResource(int id, int drawableResource) {
View view = getView(id);
if (view instanceof ImageView) {
((ImageView) view).setImageResource(drawableResource);
} else {
view.setBackgroundResource(drawableResource);
}
return this;
}
// 设置点击监听
//
public ViewHolder setOnClickListener(int id, View.OnClickListener listener) {
getView(id).setOnClickListener(listener);
return this;
}
// 设置可见
//
public ViewHolder setVisibility(int id, int visible) {
getView(id).setVisibility(visible);
return this;
}
// 设置标签
//
public ViewHolder setTag(int id, Object obj) {
getView(id).setTag(obj);
return this;
}
}
}

View File

@@ -0,0 +1,75 @@
package cc.winboll.studio.libaes;
import android.view.View;
import android.view.ViewGroup;
import androidx.viewpager.widget.PagerAdapter;
import java.util.List;
public class ImagePagerAdapter extends PagerAdapter {
/*
* 四个必须重写的方法,否则会报错
*
*/
private List<View> views;
//构造方法拿到views
public ImagePagerAdapter(List<View> views) {
this.views = views;
}
//以下四个是重写的方法
// 获取要滑动的控件的数量在这里我们以滑动的广告栏为例那么这里就应该是展示的广告图片的ImageView数量
@Override
public int getCount() {
// TODO Auto-generated method stub
return this.views.size();
}
// 来判断显示的是否是同一张图片,这里我们将两个参数相比较返回即可
@Override
public boolean isViewFromObject(View arg0, Object arg1) {
// TODO Auto-generated method stub
return arg0 == arg1;
}
/**
* position是在viewPager中显示图片的下标
* 把对应的图片放到对应的位置就好了
* instantiateItem和destroyItem是对应的
* 一个是创建item一个是销毁item
* 当要显示的图片可以进行缓存的时候会调用instantiateItem进行显示图片的初始化
* 我们将要显示的ImageView加入到ViewGroup中然后作为返回值返回即可
*
* ViewPager 是扩展于 ViewGroupcontainer参数是当前的ViewPager对象
* 所有的item都会被加入到ViewPager中
* position就是 每个item对应的下标
*/
@Override
public Object instantiateItem(ViewGroup container, int position) {
container.addView(views.get(position));
return views.get(position);
}
//如果出现IllegalStateException: The specified child already has a parent. 这样的错误则可替换为以下的try catch 代码
/*try{
    if(views.get(position).getParent()==null){
  container.addView(views.get(position));
    }else{
((ViewGroup)views.get(position).getParent()).removeView(views.get(position));
container.addView(views.get(position));
}
}catch(Exception e){
e.printStackTrace();
}*/
// PagerAdapter只缓存5张要显示的图片如果滑动的图片超出了缓存的范围就会调用destroyItem将图片销毁
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView(views.get(position));
}
}

View File

@@ -0,0 +1,384 @@
package cc.winboll.studio.libaes.activitys;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/06/13 18:58:54
* @Describe 可以加入Fragment的有抽屉的活动窗口抽象类
*/
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import cc.winboll.studio.libaes.DrawerMenuDataAdapter;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.beans.AESThemeBean;
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
import cc.winboll.studio.libaes.views.ADrawerMenuListView;
import cc.winboll.studio.libapputils.log.LogUtils;
import com.baoyz.widget.PullRefreshLayout;
import java.util.ArrayList;
public abstract class DrawerFragmentActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
public static final String TAG = "DrawerFragmentActivity";
static final String SHAREDPREFERENCES_NAME = "SHAREDPREFERENCES_NAME";
static final String DRAWER_THEME_TYPE = "DRAWER_THEME_TYPE";
protected Context mContext;
ActivityType mActivityType;
ActionBarDrawerToggle mActionBarDrawerToggle;
DrawerLayout mDrawerLayout;
PullRefreshLayout mPullRefreshLayout;
ADrawerMenuListView mADrawerMenuListView;
DrawerMenuDataAdapter mDrawerMenuDataAdapter;
boolean mIsDrawerOpened = false;
boolean mIsDrawerOpening = false;
boolean mIsDrawerClosing = false;
protected Toolbar mToolbar;
public enum ActivityType { Main, Secondary }
protected volatile AESThemeBean.ThemeType mThemeType;
protected ArrayList<DrawerMenuBean> malDrawerMenuItem;
abstract protected ActivityType initActivityType();
//abstract protected View initContentView(LayoutInflater inflater, ViewGroup rootView);
@Override
protected void onCreate(Bundle savedInstanceState) {
mContext = this;
mThemeType = getThemeType();
setThemeStyle();
super.onCreate(savedInstanceState);
mActivityType = initActivityType();
initRootView();
LogUtils.d(TAG, "onCreate end.");
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
public Intent getIntent() {
// TODO: Implement this method
return super.getIntent();
}
public Context getContext() {
return this.mContext;
}
@Override
public MenuInflater getMenuInflater() {
// TODO: Implement this method
return super.getMenuInflater();
}
public void setSubtitle(CharSequence context) {
// TODO: Implement this method
getSupportActionBar().setSubtitle(context);
}
@Override
public void recreate() {
super.recreate();
}
@Override
public boolean moveTaskToBack(boolean nonRoot) {
return super.moveTaskToBack(nonRoot);
}
@Override
public void startActivity(Intent intent) {
super.startActivity(intent);
}
@Override
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
super.startActivityForResult(intent, requestCode, options);
}
@Override
public FragmentManager getSupportFragmentManager() {
return super.getSupportFragmentManager();
}
public void setSubtitle(int resId) {
// TODO: Implement this method
getSupportActionBar().setSubtitle(resId);
}
public void setTitle(CharSequence context) {
// TODO: Implement this method
getSupportActionBar().setTitle(context);
}
public void setTitle(int resId) {
// TODO: Implement this method
getSupportActionBar().setTitle(resId);
}
@Override
public SharedPreferences getSharedPreferences(String name, int mode) {
return super.getSharedPreferences(name, mode);
}
@Override
public Context getApplicationContext() {
// TODO: Implement this method
return super.getApplicationContext();
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
void setThemeStyle() {
//setTheme(AESThemeBean.getThemeStyle(getThemeType()));
setTheme(AESThemeUtil.getThemeTypeID(this));
}
boolean checkThemeStyleChange() {
return mThemeType != getThemeType();
}
AESThemeBean.ThemeType getThemeType() {
/*SharedPreferences sharedPreferences = getSharedPreferences(
SHAREDPREFERENCES_NAME, MODE_PRIVATE);
return AESThemeBean.ThemeType.values()[((sharedPreferences.getInt(DRAWER_THEME_TYPE, AESThemeBean.ThemeType.DEFAULT.ordinal())))];
*/
return AESThemeBean.getThemeStyleType(AESThemeUtil.getThemeTypeID(this));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (AESThemeUtil.onAppThemeItemSelected(this, item)) {
recreate();
} else if (R.id.item_testappcrash == item.getItemId()) {
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
getString(i);
}
} else if (R.id.item_about == item.getItemId()) {
LogUtils.d(TAG, "onAbout");
} else if (android.R.id.home == item.getItemId()) {
LogUtils.d(TAG, "android.R.id.home");
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onResume() {
super.onResume();
if (checkThemeStyleChange()) {
recreate();
}
}
void initRootView() {
setContentView(R.layout.activity_drawerfragment);
mToolbar = findViewById(R.id.activitydrawerfragmentASupportToolbar1);
setSupportActionBar(mToolbar);
if (mActivityType == ActivityType.Main) {
initMainRootView();
} else if (mActivityType == ActivityType.Secondary) {
initSecondaryRootView();
}
}
void initMainRootView() {
mDrawerLayout = findViewById(R.id.activitydrawerfragmentDrawerLayout1);
mADrawerMenuListView = findViewById(R.id.activitydrawerfragmentDrawerMenuListView1);
mPullRefreshLayout = findViewById(R.id.activitydrawerfragmentPullRefreshLayout1);
mPullRefreshLayout.setOnRefreshListener(new PullRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
//LogUtils.d(TAG, "onRefresh");
reinitDrawerMenuItemList(malDrawerMenuItem);
mDrawerMenuDataAdapter.notifyDataSetChanged();
mPullRefreshLayout.setRefreshing(false);
}
});
malDrawerMenuItem = new ArrayList<DrawerMenuBean>();
mDrawerMenuDataAdapter = new DrawerMenuDataAdapter<DrawerMenuBean>(malDrawerMenuItem, R.layout.listview_drawermenu) {
@Override
public void bindView(ViewHolder holder, DrawerMenuBean obj) {
holder.setImageResource(R.id.listviewdrawermenuImageView1, obj.getIconId());
holder.setText(R.id.listviewdrawermenuTextView1, obj.getIconName());
}
};
mADrawerMenuListView.setAdapter(mDrawerMenuDataAdapter);
mADrawerMenuListView.setOnItemClickListener(this);
mActionBarDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, R.string.lib_name, R.string.lib_name) {
@Override
public void onDrawerOpened(View drawerView) {//完全打开时触发
super.onDrawerOpened(drawerView);
mIsDrawerOpened = true;
mIsDrawerOpening = false;
//Toast.makeText(MainActivity.this,"onDrawerOpened",Toast.LENGTH_SHORT).show();
}
@Override
public void onDrawerClosed(View drawerView) {//完全关闭时触发
super.onDrawerClosed(drawerView);
mIsDrawerOpened = false;
mIsDrawerClosing = false;
//Toast.makeText(MainActivity.this,"onDrawerClosed",Toast.LENGTH_SHORT).show();
}
/**
* 当抽屉被滑动的时候调用此方法
* slideOffset表示 滑动的幅度0-1
*/
@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, slideOffset);
}
/**
* 当抽屉滑动状态改变的时候被调用
* 状态值是STATE_IDLE闲置--0, STATE_DRAGGING拖拽的--1, STATE_SETTLING固定--2中之一。
*具体状态可以慢慢调试
*/
@Override
public void onDrawerStateChanged(int newState) {
super.onDrawerStateChanged(newState);
}
};
//设置显示旋转菜单
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//通过下面这句实现toolbar和Drawer的联动如果没有这行代码箭头是不会随着侧滑菜单的开关而变换的或者没有箭头
// 可以尝试一下,不影响正常侧滑
mActionBarDrawerToggle.syncState();
mDrawerLayout.setDrawerListener(mActionBarDrawerToggle);
//去掉侧滑的默认图标(动画箭头图标),也可以选择不去,
//不去的话把这一行注释掉或者改成true然后把toolbar.setNavigationIcon注释掉就行了
//mActionBarDrawerToggle.setDrawerIndicatorEnabled(false);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mIsDrawerOpened || mIsDrawerOpening) {
mIsDrawerClosing = true;
mIsDrawerOpening = false;
mDrawerLayout.closeDrawer(mPullRefreshLayout);
return;
}
if (!mIsDrawerOpened || mIsDrawerClosing) {
mIsDrawerOpening = true;
mIsDrawerClosing = false;
mDrawerLayout.openDrawer(mPullRefreshLayout);
return;
}
}
});
initDrawerMenuItemList(malDrawerMenuItem);
}
void initSecondaryRootView() {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//LogUtils.d(TAG, "onClick " + Integer.toString(v.getId()));
finish();
}
});
}
public <T extends Fragment> int removeFragment(T fragment) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.remove(fragment);
fragmentTransaction.commit();
return fragmentManager.getFragments().size() - 1;
}
public <T extends Fragment> int addFragment(T fragment) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.activitydrawerfragmentFrameLayout1, fragment);
fragmentTransaction.commit();
return fragmentManager.getFragments().size() - 1;
}
public <T extends Fragment> void showFragment(T fragment) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
for (int i = 0; i < fragmentManager.getFragments().size(); i++) {
if (fragmentManager.getFragments().get(i).equals(fragment)) {
fragmentTransaction.show(fragmentManager.getFragments().get(i));
} else {
fragmentTransaction.hide(fragmentManager.getFragments().get(i));
}
}
fragmentTransaction.commit();
}
public void showFragment(int nPosition) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
for (int i = 0; i < fragmentManager.getFragments().size(); i++) {
if (i == nPosition) {
fragmentTransaction.show(fragmentManager.getFragments().get(i));
} else {
fragmentTransaction.hide(fragmentManager.getFragments().get(i));
}
}
fragmentTransaction.commit();
}
protected void initDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
}
protected void reinitDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
}
public void notifyDrawerMenuDataChanged() {
mDrawerMenuDataAdapter.notifyDataSetChanged();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
mDrawerLayout.closeDrawer(mPullRefreshLayout);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (mActivityType == ActivityType.Main) {
AESThemeUtil.inflateMenu(this, menu);
getMenuInflater().inflate(R.menu.toolbar_drawerbase, menu);
}
return super.onCreateOptionsMenu(menu);
}
@Override
protected void onActivityResult(int who, int targetFragment, Intent requestCode) {
super.onActivityResult(who, targetFragment, requestCode);
}
}

View File

@@ -0,0 +1,138 @@
package cc.winboll.studio.libaes.beans;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/06/14 02:42:57
* @Describe 主题元素项目类
*/
import android.util.JsonReader;
import android.util.JsonWriter;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libapputils.bean.BaseBean;
import java.io.IOException;
public class AESThemeBean extends BaseBean {
public static final String TAG = "AESThemeBean";
public enum ThemeType {
DEFAULT("默认主题"),
DEPTH("深奥主题"),
SKY("天空主题"),
GOLDEN("辉煌主题"),
MEMOR("梦箩主题"),
TAO("黑白主题");
private String name;
// 枚举构造函数
ThemeType(String name) {
this.name = name;
}
// 将字符串转换为枚举
public static ThemeType fromString(String themeTypeStr) {
return ThemeType.valueOf(themeTypeStr.toUpperCase()); // 注意这里用了toUpperCase(),确保匹配时不区分大小写
}
// 获取枚举的名称
public String getName() {
return name;
}
}
// 保存当前主题
int currentThemeStyleID = getThemeStyleID(ThemeType.DEFAULT);
public AESThemeBean() {
}
public AESThemeBean(int currentThemeStyleID) {
this.currentThemeStyleID = currentThemeStyleID;
}
public void setCurrentThemeTypeID(int currentThemeTypeID) {
this.currentThemeStyleID = currentThemeTypeID;
}
public int getCurrentThemeTypeID() {
return this.currentThemeStyleID;
}
@Override
public String getName() {
return AESThemeBean.class.getName();
}
@Override
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
super.writeThisToJsonWriter(jsonWriter);
AESThemeBean bean = this;
jsonWriter.name("currentThemeTypeID").value(bean.getCurrentThemeTypeID());
}
@Override
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
if(super.initObjectsFromJsonReader(jsonReader, name)) { return true; }
else{
if (name.equals("currentThemeTypeID")) {
setCurrentThemeTypeID(jsonReader.nextInt());
} else {
return false;
}
}
return true;
}
@Override
public BaseBean readBeanFromJsonReader(JsonReader jsonReader) throws IOException {
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String name = jsonReader.nextName();
if(!initObjectsFromJsonReader(jsonReader, name)) {
jsonReader.skipValue();
}
}
// 结束 JSON 对象
jsonReader.endObject();
return this;
}
public static int getThemeStyleID(ThemeType themeType) {
int themeStyleID = R.style.DefaultAESTheme;
if (AESThemeBean.ThemeType.DEPTH == themeType) {
themeStyleID = R.style.DepthAESTheme;
} else if (AESThemeBean.ThemeType.SKY == themeType) {
themeStyleID = R.style.SkyAESTheme;
} else if (AESThemeBean.ThemeType.GOLDEN == themeType) {
themeStyleID = R.style.GoldenAESTheme;
} else if (AESThemeBean.ThemeType.MEMOR == themeType) {
themeStyleID = R.style.MemorAESTheme;
} else if (AESThemeBean.ThemeType.TAO == themeType) {
themeStyleID = R.style.TaoAESTheme;
} else if (AESThemeBean.ThemeType.DEFAULT == themeType) {
themeStyleID = R.style.DefaultAESTheme;
}
//LogUtils.d(TAG, "themeStyleID " + Integer.toString(themeStyleID));
return themeStyleID;
}
public static AESThemeBean.ThemeType getThemeStyleType(int nThemeStyleID) {
AESThemeBean.ThemeType themeStyle = AESThemeBean.ThemeType.DEFAULT;
if (R.style.DepthAESTheme == nThemeStyleID) {
themeStyle = AESThemeBean.ThemeType.DEPTH ;
} else if (R.style.SkyAESTheme == nThemeStyleID) {
themeStyle = AESThemeBean.ThemeType.SKY ;
} else if (R.style.GoldenAESTheme == nThemeStyleID) {
themeStyle = AESThemeBean.ThemeType.GOLDEN ;
} else if (R.style.MemorAESTheme == nThemeStyleID) {
themeStyle = AESThemeBean.ThemeType.MEMOR ;
} else if (R.style.TaoAESTheme == nThemeStyleID) {
themeStyle = AESThemeBean.ThemeType.TAO ;
} else if (R.style.DefaultAESTheme == nThemeStyleID) {
themeStyle = AESThemeBean.ThemeType.DEFAULT;
}
//LogUtils.d(TAG, "themeStyle " + Integer.toString(themeStyle.ordinal()));
return themeStyle;
}
}

View File

@@ -0,0 +1,35 @@
package cc.winboll.studio.libaes.beans;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/06/14 01:53:34
* @Describe 抽屉菜单项目类
*/
public class DrawerMenuBean {
public static final String TAG = "DrawerMenuBean";
private int iconId;
private String iconName;
public DrawerMenuBean(int iconId, String iconName) {
this.iconId = iconId;
this.iconName = iconName;
}
public int getIconId() {
return iconId;
}
public String getIconName() {
return iconName;
}
public void setIconId(int iconId) {
this.iconId = iconId;
}
public void setIconName(String iconName) {
this.iconName = iconName;
}
}

View File

@@ -0,0 +1,204 @@
package cc.winboll.studio.libaes.dialogs;
import android.content.Context;
import android.content.DialogInterface;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import cc.winboll.studio.libapputils.log.LogUtils;
import java.io.File;
import java.lang.reflect.Field;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
public class LocalFileSelectDialog {
public static final String TAG = LocalFileSelectDialog.class.getSimpleName();
File mfCurrentPath = new File("/storage/emulated/0");
String mszResultPath = "/storage/emulated/0";
OKClickListener mOKClickListener;
Context mContext;
public LocalFileSelectDialog(Context context) {
mContext = context;
}
public void open() {
LogUtils.d(TAG, "call open()");
String[] szlist = getChildFileList(mfCurrentPath);
if (szlist != null) {
showSingleChoiceDialog(szlist, 0);
}
}
int yourChoice;
protected void showSingleChoiceDialog(final String[] szItems, final int nChoice) {
LogUtils.d(TAG, "call showSingleChoiceDialog(...)");
yourChoice = nChoice;
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
String sz = mfCurrentPath.getPath();
builder.setTitle(sz);
//builder.setCancelable(false);
builder.setSingleChoiceItems(szItems, nChoice,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
yourChoice = which;
}
});
// 确定按钮
builder.setPositiveButton("确定",
new DialogInterface.OnClickListener() {
@Override
public void onClick(
DialogInterface dialog,
int which) {
mszResultPath = mfCurrentPath.getPath() + File.separator + szItems[yourChoice];
//Toast.makeText(mContext, mszResultPath, Toast.LENGTH_SHORT).show();
mOKClickListener.onOKClick(mszResultPath);
}
});
// 下一层文件按钮
builder.setNegativeButton(">>>", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
File file = new File(mfCurrentPath.getPath() + File.separator + szItems[yourChoice]);
String[] szlist = getChildFileList(file);
if (szlist != null) {
mfCurrentPath = new File(mfCurrentPath.getPath() + File.separator + szItems[yourChoice]);
showSingleChoiceDialog(szlist, 0);
} else {
Toast.makeText(mContext, "这是一个最低的目录", Toast.LENGTH_SHORT).show();
String[] szlistOld = getChildFileList(mfCurrentPath);
showSingleChoiceDialog(szlistOld, yourChoice);
}
}
});
// 上一层文件按钮
builder.setNeutralButton("<<<",
new DialogInterface.OnClickListener() {// 添加返回按钮
@Override
public void onClick(
DialogInterface dialog,
int which) {// 响应事件
String[] szlist = getChildFileList(mfCurrentPath.getParentFile());
if (szlist != null) {
mfCurrentPath = mfCurrentPath.getParentFile();
showSingleChoiceDialog(szlist, 0);
} else {
Toast.makeText(mContext, "这是一个最高的目录", Toast.LENGTH_SHORT).show();
String[] szlistOld = getChildFileList(mfCurrentPath);
showSingleChoiceDialog(szlistOld, yourChoice);
}
}
});
AlertDialog dialog = builder.create();
dialog.show();
// 反射原理修改对话框元素
//
//需要在show()方法之后才能修改
//修改“确认”、“取消”按钮的字体大小
//dialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextSize(16);
//dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextSize(16);
//dialog.getButton(DialogInterface.BUTTON_NEUTRAL).setTextSize(16);
try {
Field mAlert = AlertDialog.class.getDeclaredField("mAlert");
mAlert.setAccessible(true);
Object mAlertController = mAlert.get(dialog);
//通过反射修改title字体大小和颜色
Field mTitle = mAlertController.getClass().getDeclaredField("mTitleView");
mTitle.setAccessible(true);
TextView mTitleView = (TextView) mTitle.get(mAlertController);
//mTitleView.setTextSize(16);
//mTitleView.setTextColor(Color.RED);
mTitleView.setSingleLine(false);
//通过反射修改message字体大小和颜色
//Field mMessage = mAlertController.getClass().getDeclaredField("mMessageView");
//mMessage.setAccessible(true);
//TextView mMessageView = (TextView) mMessage.get(mAlertController);
//mMessageView.setTextSize(16);
//mMessageView.setTextColor(Color.GREEN);
} catch (IllegalAccessException e) {
LogUtils.d(TAG, "IllegalAccessException : " + e.getMessage());
} catch (NoSuchFieldException e) {
LogUtils.d(TAG, "NoSuchFieldException : " + e.getMessage());
}
}
public void setOnOKClickListener(OKClickListener listener) {
mOKClickListener = listener;
}
public interface OKClickListener {
void onOKClick(String szResultPath);
}
// 读取文件夹子目录
//
// "/storage/emulated/0"以上
// 和没有子目录的f参数返回空列表
protected String[] getChildFileList(File file) {
ArrayList<String> szlistFiles = new ArrayList<String>();
if (!file.getPath().equals("/storage/emulated")) {
File[] fileList = file.listFiles();
if (fileList != null) {
for (File fileItem : fileList) {
if (fileItem.getName().charAt(0) != '.') {
if (fileItem.isDirectory()) {
szlistFiles.add(fileItem.getName());
}
}
}
}
}
Collections.sort(szlistFiles, new SortChineseName(true));
if (szlistFiles.size() > 0) {
return szlistFiles.toArray(new String[szlistFiles.size()]);
} else {
return null;
}
}
private class SortChineseName implements Comparator<String> {
private boolean mIsA2Z = true;
public SortChineseName(boolean isA2Z) {
mIsA2Z = isA2Z;
}
Collator cmp = Collator.getInstance(java.util.Locale.CHINA);
@Override
public int compare(String o1, String o2) {
if (mIsA2Z) {
if (cmp.compare(o1, o2) > 0) {
return 1;
} else if (cmp.compare(o1, o2) < 0) {
return -1;
}
} else {
if (cmp.compare(o1, o2) > 0) {
return -1;
} else if (cmp.compare(o1, o2) < 0) {
return 1;
}
}
return 0;
}
}
}

View File

@@ -0,0 +1,57 @@
package cc.winboll.studio.libaes.dialogs;
import android.app.Dialog;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.utils.ScreenUtil;
public class StoragePathDialog extends Dialog {
public static final String TAG = "StoragePathDialog";
View.OnClickListener mOnOKClickListener;
public StoragePathDialog(android.content.Context context) {
super(context);
}
public StoragePathDialog(android.content.Context context, int themeResId) {
super(context, (themeResId == 0) ? cc.winboll.studio.libaes.R.style.NormalDialogStyle: themeResId);
// 加载默认布局
View view = View.inflate(context, R.layout.dialog_storagepath, null);
setContentView(view);
// 添加按键点击监听
view.findViewById(R.id.dialogstoragepathButton1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mOnOKClickListener != null) {
mOnOKClickListener.onClick(view);
}
}
});
// 使得点击对话框外部不消失对话框
setCanceledOnTouchOutside(false);
// 设置对话框大小
ScreenUtil.ScreenSize ss = ScreenUtil.getScreenSize(context);
view.setMinimumHeight((int) (ss.getHeightPixels() * 0.23f));
Window dialogWindow = getWindow();
WindowManager.LayoutParams lp = dialogWindow.getAttributes();
lp.width = (int) (ss.getWidthPixels() * 0.75f);
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
lp.gravity = Gravity.CENTER;
dialogWindow.setAttributes(lp);
}
protected StoragePathDialog(android.content.Context context, boolean cancelable, android.content.DialogInterface.OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
}
public void setOnOKClickListener(View.OnClickListener listener) {
mOnOKClickListener = listener;
}
}

View File

@@ -0,0 +1,170 @@
package cc.winboll.studio.libaes.unittests;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/06/14 03:43:23
* @Describe AES类库主窗口
*/
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Toast;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
import cc.winboll.studio.libaes.dialogs.LocalFileSelectDialog;
import cc.winboll.studio.libaes.dialogs.StoragePathDialog;
import cc.winboll.studio.libapputils.log.LogUtils;
import com.a4455jkjh.colorpicker.ColorPickerDialog;
import java.util.ArrayList;
public class LibraryActivity extends DrawerFragmentActivity {
public static final String TAG = "LibraryActivity";
TestAButtonFragment mTestAButtonFragment;
TestViewPageFragment mTestViewPageFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (mTestAButtonFragment == null) {
mTestAButtonFragment = new TestAButtonFragment();
addFragment(mTestAButtonFragment);
}
showFragment(mTestAButtonFragment);
setSubtitle(TAG);
}
@Override
public void initDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
super.initDrawerMenuItemList(listDrawerMenu);
LogUtils.d(TAG, "initDrawerMenuItemList");
//listDrawerMenu.clear();
// 添加抽屉菜单项
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
notifyDrawerMenuDataChanged();
}
@Override
public void reinitDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
super.reinitDrawerMenuItemList(listDrawerMenu);
LogUtils.d(TAG, "reinitDrawerMenuItemList");
//listDrawerMenu.clear();
// 添加抽屉菜单项
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestAButtonFragment.TAG));
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestViewPageFragment.TAG));
notifyDrawerMenuDataChanged();
}
@Override
public DrawerFragmentActivity.ActivityType initActivityType() {
return DrawerFragmentActivity.ActivityType.Main;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.toolbar_library, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
super.onItemClick(parent, view, position, id);
switch (position) {
case 0 : {
if (mTestAButtonFragment == null) {
mTestAButtonFragment = new TestAButtonFragment();
addFragment(mTestAButtonFragment);
}
showFragment(mTestAButtonFragment);
break;
}
case 1 : {
if (mTestViewPageFragment == null) {
mTestViewPageFragment = new TestViewPageFragment();
addFragment(mTestViewPageFragment);
}
showFragment(mTestViewPageFragment);
break;
}
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int nItemId = item.getItemId();
// if (item.getItemId() == R.id.item_log) {
// WinBollActivityManager.getInstance(this).startWinBollActivity(getApplicationContext(), LogActivity.class);
// } else
if (nItemId == R.id.item_atoast) {
Toast.makeText(getApplication(), "item_testatoast", Toast.LENGTH_SHORT).show();
} else if (nItemId == R.id.item_atoolbar) {
Intent intent = new Intent(this, TestAToolbarActivity.class);
startActivity(intent);
} else if (nItemId == R.id.item_asupporttoolbar) {
Intent intent = new Intent(this, TestASupportToolbarActivity.class);
startActivity(intent);
} else if (nItemId == R.id.item_colordialog) {
ColorPickerDialog dlg = new ColorPickerDialog(this, getResources().getColor(R.color.colorPrimary));
dlg.setOnColorChangedListener(new com.a4455jkjh.colorpicker.view.OnColorChangedListener() {
@Override
public void beforeColorChanged() {
}
@Override
public void onColorChanged(int color) {
}
@Override
public void afterColorChanged() {
}
});
dlg.show();
} else if (nItemId == R.id.item_dialogstoragepath) {
final StoragePathDialog dialog = new StoragePathDialog(this, 0);
dialog.setOnOKClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
} else if (nItemId == R.id.item_localfileselectdialog) {
final LocalFileSelectDialog dialog = new LocalFileSelectDialog(this);
dialog.setOnOKClickListener(new LocalFileSelectDialog.OKClickListener() {
@Override
public void onOKClick(String sz) {
Toast.makeText(getApplication(), sz, Toast.LENGTH_SHORT).show();
//dialog.dismiss();
}
});
dialog.open();
} else if (nItemId == R.id.item_secondarylibraryactivity) {
Intent intent = new Intent(this, SecondaryLibraryActivity.class);
startActivity(intent);
} else if (nItemId == R.id.item_drawerfragmentactivity) {
Intent intent = new Intent(this, TestDrawerFragmentActivity.class);
startActivity(intent);
}
// else if (nItemId == R.id.item_about) {
// Intent intent = new Intent(this, AboutActivity.class);
// startActivity(intent);
// }
return super.onOptionsItemSelected(item);
}
}

View File

@@ -0,0 +1,50 @@
package cc.winboll.studio.libaes.unittests;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/06/15 00:58:10
* @Describe 第二级窗口
*/
public class SecondaryLibraryActivity extends DrawerFragmentActivity {
public static final String TAG = "SecondaryLibraryActivity";
SecondaryLibraryFragment mSecondaryLibraryFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (mSecondaryLibraryFragment == null) {
mSecondaryLibraryFragment = new SecondaryLibraryFragment();
addFragment(mSecondaryLibraryFragment);
}
showFragment(mSecondaryLibraryFragment);
}
@Override
public DrawerFragmentActivity.ActivityType initActivityType() {
return DrawerFragmentActivity.ActivityType.Secondary;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.toolbar_secondarylibrary, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int nItemId = item.getItemId();
if (nItemId == R.id.item_test) {
Toast.makeText(getApplication(), "item_test", Toast.LENGTH_SHORT).show();
}
return super.onOptionsItemSelected(item);
}
}

View File

@@ -0,0 +1,25 @@
package cc.winboll.studio.libaes.unittests;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 02:36:34
* @Describe SecondaryLibraryFragment
*/
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import cc.winboll.studio.libaes.R;
public class SecondaryLibraryFragment extends Fragment {
public static final String TAG = "SecondaryLibraryFragment";
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_secondarylibrary, container, false);
return view;
}
}

View File

@@ -0,0 +1,37 @@
package cc.winboll.studio.libaes.unittests;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:27:50
* @Describe TestAButtonFragment
*/
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.views.AButton;
import cc.winboll.studio.libapputils.log.LogUtils;
public class TestAButtonFragment extends Fragment {
public static final String TAG = "TestAButtonFragment";
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_abutton, container, false);
AButton aButton = view.findViewById(R.id.fragmentabuttonAButton1);
aButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LogUtils.d(TAG, "onClick");
Toast.makeText(getActivity(), "AButton", Toast.LENGTH_SHORT).show();
}
});
return view;
}
}

View File

@@ -0,0 +1,34 @@
package cc.winboll.studio.libaes.unittests;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:14:00
* @Describe TestASupportToolbarActivity
*/
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.beans.AESThemeBean;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
public class TestASupportToolbarActivity extends AppCompatActivity {
public static final String TAG = "TestASupportToolbarActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
AESThemeUtil.applyAppTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_testasupporttoolbar);
Toolbar toolbar = findViewById(R.id.activitytestasupporttoolbarASupportToolbar1);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(TAG);
}
}

View File

@@ -0,0 +1,28 @@
package cc.winboll.studio.libaes.unittests;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:16:07
* @Describe TestAToolbarActivity
*/
import android.app.Activity;
import android.os.Bundle;
import android.widget.Toolbar;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
public class TestAToolbarActivity extends Activity {
public static final String TAG = "TestAToolbarActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
AESThemeUtil.applyAppTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_testatoolbar);
Toolbar toolbar = findViewById(R.id.activitytestatoolbarAToolbar1);
setActionBar(toolbar);
getActionBar().setTitle(TAG);
}
}

View File

@@ -0,0 +1,111 @@
package cc.winboll.studio.libaes.unittests;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/06/30 15:00:51
*/
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
import cc.winboll.studio.libapputils.log.LogUtils;
import java.util.ArrayList;
public class TestDrawerFragmentActivity extends DrawerFragmentActivity {
public static final String TAG = "TestDrawerFragmentActivity";
TestFragment1 mTestFragment1;
TestFragment2 mTestFragment2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mTestFragment1 = new TestFragment1();
addFragment(mTestFragment1);
mTestFragment2 = new TestFragment2();
addFragment(mTestFragment2);
showFragment(0);
}
@Override
protected DrawerFragmentActivity.ActivityType initActivityType() {
return DrawerFragmentActivity.ActivityType.Main;
}
@Override
public void initDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
super.initDrawerMenuItemList(listDrawerMenu);
LogUtils.d(TAG, "initDrawerMenuItemList");
//listDrawerMenu.clear();
// 添加抽屉菜单项
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestFragment1.TAG));
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestFragment2.TAG));
notifyDrawerMenuDataChanged();
}
@Override
public void reinitDrawerMenuItemList(ArrayList<DrawerMenuBean> listDrawerMenu) {
super.reinitDrawerMenuItemList(listDrawerMenu);
LogUtils.d(TAG, "reinitDrawerMenuItemList");
//listDrawerMenu.clear();
// 添加抽屉菜单项
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestFragment1.TAG));
listDrawerMenu.add(new DrawerMenuBean(R.drawable.ic_launcher, TestFragment2.TAG));
notifyDrawerMenuDataChanged();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
super.onItemClick(parent, view, position, id);
switch (position) {
case 0 : {
Toast.makeText(getContext(), "0", Toast.LENGTH_SHORT).show();
//LogUtils.d(TAG, "MenuItem 1");
showFragment(mTestFragment1);
break;
}
case 1 : {
//LogUtils.d(TAG, "MenuItem 2");
showFragment(mTestFragment2);
break;
}
}
}
public static class TestFragment1 extends Fragment {
public static final String TAG = "TestFragment1";
View mView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mView = inflater.inflate(R.layout.fragment_test1, container, false);
return mView;
}
}
public static class TestFragment2 extends Fragment {
public static final String TAG = "TestFragment2";
View mView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mView = inflater.inflate(R.layout.fragment_test2, container, false);
return mView;
}
}
}

View File

@@ -0,0 +1,199 @@
package cc.winboll.studio.libaes.unittests;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:35:56
* @Describe TestViewPageFragment
*/
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import cc.winboll.studio.libaes.ImagePagerAdapter;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
import java.util.ArrayList;
import java.util.List;
public class TestViewPageFragment extends Fragment implements ViewPager.OnPageChangeListener, View.OnClickListener {
public static final String TAG = "TestViewPageFragment";
private ViewPager viewPager;
private List<View> views; //用来存放放进ViewPager里面的布局
//实例化存储imageView导航原点的集合
ImageView[] imageViews;
private ImagePagerAdapter adapter;//适配器
private LinearLayout linearLayout;//下标所在在LinearLayout布局里
private int currentPoint = 0;//当前被选中中页面的下标
View mView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mView = inflater.inflate(R.layout.fragment_viewpage, container, false);
//viewPager = findViewById(R.id.activitymainViewPager1);
initData();
initView();//调用初始化视图方法
initPoint();//调用初始化导航原点的方法
viewPager.addOnPageChangeListener(this);//滑动事件
//viewPager.setAdapter(new MyAdapter());
// 获取屏幕参数
//ScreenUtil.ScreenSize ss = ScreenUtil.getScreenSize(MainActivity.this);
//Toast.makeText(getApplication(), Integer.toString(ss.getHeightPixels())+" "+Integer.toString(ss.getWidthPixels()), Toast.LENGTH_SHORT).show();
return mView;
}
//初始化view即显示的图片
void initView() {
adapter = new ImagePagerAdapter(views);
viewPager = mView.findViewById(R.id.fragmentviewpageViewPager1);
viewPager.setAdapter(adapter);
linearLayout = mView.findViewById(R.id.fragmentviewpageLinearLayout1);
initPoint();//初始化页面下方的点
viewPager.setOnPageChangeListener(this);
initAOHPCTCSeekBar();
}
//初始化所要显示的布局
void initData() {
ViewPager viewPager = mView.findViewById(R.id.fragmentviewpageViewPager1);
LayoutInflater inflater = LayoutInflater.from(getActivity());
View view1 = inflater.inflate(R.layout.viewpage_atickprogressbar, viewPager, false);
View view2 = inflater.inflate(R.layout.viewpage_acard, viewPager, false);
View view3 = inflater.inflate(R.layout.viewpage_aohpctccard, viewPager, false);
View view4 = inflater.inflate(R.layout.viewpage_aohpctcsb, viewPager, false);
views = new ArrayList<>();
views.add(view1);
views.add(view2);
views.add(view3);
views.add(view4);
}
//setTag注释
/*
//View中的setTagOnbect表示给View添加一个格外的数据以后可以用getTag()将这个数据取出来。来
代表这个数据,即实例化
Tag是标签的bai意识这里的tag是object类型。所以通常会使用setTag()设置不同的Object子类对象
然后使用强制转换getTag()获得对象。
//可以用在多个Button添加一个监听器每个Button都设置不同的setTag。
这个监听器就通过getTag来分辨是哪个Button 被按下。
public class Main extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button button1 = (Button) findViewById(R.id.Button01);
Button button2 = (Button) findViewById(R.id.Button02);
Button button3 = (Button) findViewById(R.id.Button03);
Button button4 = (Button) findViewById(R.id.Button04);
MyListener listener = new MyListener();
button1.setTag(1);
button1.setOnClickListener(listener);
button2.setTag(2);
button2.setOnClickListener(listener);
button3.setTag(3);
button3.setOnClickListener(listener);
button4.setTag(4);
button4.setOnClickListener(listener);
}
public class MyListener implements View.OnClickListener {
@Override
public void onClick(View v) {
int tag = (Integer) v.getTag();
switch (tag) {
case 1:
System.out.println(“button1 click”);
break;
case 2:
System.out.println(“button2 click”);
break;
case 3:
System.out.println(“button3 click”);
break;
case 4:
System.out.println(“button4 click”);
break;
}
*/
private void initPoint() {
imageViews = new ImageView[5];//实例化5个图片
for (int i = 0; i < linearLayout.getChildCount(); i++) {
imageViews[i] = (ImageView) linearLayout.getChildAt(i);
imageViews[i].setImageResource(R.drawable.ic_arrow_left_right_bold);
imageViews[i].setOnClickListener(this);//点击导航点,即可跳转
imageViews[i].setTag(i);//重复利用实例化的对象
}
currentPoint = 0;//默认第一个坐标
imageViews[currentPoint].setImageResource(R.drawable.ic_arrow_up_circle_outline);
}
//OnPageChangeListener接口要实现的三个方法
/* onPageScrollStateChanged(int state)
此方法是在状态改变的时候调用其中state这个参数有三种状态
SCROLL_STATE_DRAGGING1表示用户手指“按在屏幕上并且开始拖动”的状态
手指按下但是还没有拖动的时候还不是这个状态只有按下并且手指开始拖动后log才打出。
SCROLL_STATE_IDLE0滑动动画做完的状态。
SCROLL_STATE_SETTLING2在“手指离开屏幕”的状态。*/
@Override
public void onPageScrollStateChanged(int state) {
}
/* onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
当页面在滑动的时候会调用此方法,在滑动被停止之前,此方法回一直得到调用。其中三个参数的含义分别为:
position :当前页面即你点击滑动的页面从A滑B则是A页面的position。
positionOffset:当前页面偏移的百分比
positionOffsetPixels:当前页面偏移的像素位置*/
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
/* onPageSelected(int position)
此方法是页面滑动完后得到调用position是你当前选中的页面的Position位置编号
(从A滑动到B就是B的position)*/
public void onPageSelected(int position) {
ImageView preView = imageViews[currentPoint];
preView.setImageResource(R.drawable.ic_arrow_left_right_bold);
ImageView currView = imageViews[position];
currView.setImageResource(R.drawable.ic_arrow_up_circle_outline);
currentPoint = position;
}
//小圆点点击事件
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
//通过getTag(),可以判断是哪个控件
int i = (Integer) v.getTag();
viewPager.setCurrentItem(i);//直接跳转到某一个页面的情况
}
void initAOHPCTCSeekBar() {
AOHPCTCSeekBar seekbar = mView.findViewById(R.id.fragmentviewpageAOHPCTCSeekBar1);
seekbar.setThumb(getActivity().getDrawable(R.drawable.ic_launcher));
seekbar.setThumbOffset(10);
seekbar.setOnOHPCListener(new AOHPCTCSeekBar.OnOHPCListener() {
@Override
public void onOHPCommit() {
Toast.makeText(getActivity(), "onOHPCommit ", Toast.LENGTH_SHORT).show();
}
});
}
}

View File

@@ -0,0 +1,164 @@
package cc.winboll.studio.libaes.utils;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/11/29 22:52:09
* @Describe AES 主题工具集
*/
import android.app.Activity;
import android.content.Context;
import android.view.Menu;
import android.view.MenuItem;
import androidx.appcompat.app.AppCompatActivity;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.beans.AESThemeBean;
import cc.winboll.studio.libapputils.app.WinBollActivity;
public class AESThemeUtil {
public static final String TAG = "AESThemeUtil";
static final String SHAREDPREFERENCES_NAME = "SHAREDPREFERENCES_NAME";
static final String DRAWER_THEME_TYPE = "DRAWER_THEME_TYPE";
protected volatile AESThemeBean.ThemeType mThemeType;
public static <T extends Context> int getThemeTypeID(T context) {
AESThemeBean bean = AESThemeBean.loadBean(context, AESThemeBean.class);
return bean == null ? AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT): bean.getCurrentThemeTypeID();
}
public static <T extends Context> void saveThemeStyleID(T context, int nThemeTypeID) {
AESThemeBean bean = new AESThemeBean(nThemeTypeID);
AESThemeBean.saveBean(context, bean);
}
public static <T extends Activity> void applyAppTheme(T activity) {
activity.setTheme(getThemeTypeID(activity));
}
public static <T extends AppCompatActivity> void applyAppCompatTheme(T activity) {
activity.setTheme(getThemeTypeID(activity));
}
public static <T extends WinBollActivity> void applyWinBollTheme(T activity) {
activity.setTheme(getThemeTypeID(activity.getApplicationContext()));
}
public static <T extends Activity> void applyAppTheme(Activity activity, AESThemeBean.ThemeType themeType) {
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
}
public static <T extends AppCompatActivity> void applyAppCompatTheme(Activity activity, AESThemeBean.ThemeType themeType) {
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
}
public static <T extends WinBollActivity> void applyWinBollTheme(Activity activity, AESThemeBean.ThemeType themeType) {
activity.setTheme(AESThemeBean.getThemeStyleID(themeType));
}
public static <T extends Activity> void inflateMenu(T activity, Menu menu) {
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
}
public static <T extends AppCompatActivity> void inflateCompatMenu(T activity, Menu menu) {
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
}
public static <T extends WinBollActivity> void inflateWinBollMenu(T activity, Menu menu) {
activity.getMenuInflater().inflate(R.menu.toolbar_apptheme, menu);
}
public static <T extends Activity> boolean onAppThemeItemSelected(T activity, MenuItem item) {
int nThemeStyleID;
if (R.id.item_depththeme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_skytheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.SKY);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_goldentheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.GOLDEN);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_memortheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.MEMOR);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_taotheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.TAO);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_defaulttheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
saveThemeStyleID(activity, nThemeStyleID);
return true;
}
return false;
}
public static <T extends AppCompatActivity> boolean onAppCompatThemeItemSelected(T activity, MenuItem item) {
int nThemeStyleID;
if (R.id.item_depththeme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_skytheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.SKY);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_goldentheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.GOLDEN);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_memortheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.MEMOR);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_taotheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.TAO);
saveThemeStyleID(activity, nThemeStyleID);
return true;
} else if (R.id.item_defaulttheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
saveThemeStyleID(activity, nThemeStyleID);
return true;
}
return false;
}
public static <T extends WinBollActivity> boolean onWinBollThemeItemSelected(T activity, MenuItem item) {
int nThemeStyleID;
if (R.id.item_depththeme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEPTH);
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
return true;
} else if (R.id.item_skytheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.SKY);
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
return true;
} else if (R.id.item_goldentheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.GOLDEN);
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
return true;
} else if (R.id.item_memortheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.MEMOR);
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
return true;
} else if (R.id.item_taotheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.TAO);
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
return true;
} else if (R.id.item_defaulttheme == item.getItemId()) {
nThemeStyleID = AESThemeBean.getThemeStyleID(AESThemeBean.ThemeType.DEFAULT);
saveThemeStyleID(activity.getApplicationContext(), nThemeStyleID);
return true;
}
return false;
}
}

View File

@@ -0,0 +1,64 @@
package cc.winboll.studio.libaes.utils;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.WindowManager;
public class ScreenUtil {
// 分辨率宽度和高度计量类
//
public static class ScreenSize {
int widthPixels;
int heightPixels;
public ScreenSize(int widthPixels, int heightPixels) {
this.widthPixels = widthPixels;
this.heightPixels = heightPixels;
}
public void setWidthPixels(int widthPixels) {
this.widthPixels = widthPixels;
}
public int getWidthPixels() {
return widthPixels;
}
public void setHeightPixels(int heightPixels) {
this.heightPixels = heightPixels;
}
public int getHeightPixels() {
return heightPixels;
}
}
// 获取屏幕分辨率宽度和高度
//
public static ScreenSize getScreenSize(Context mContext) {
WindowManager manager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
manager.getDefaultDisplay().getMetrics(dm);
return new ScreenSize(dm.widthPixels, dm.heightPixels);
}
// 获取屏幕宽度
//
public static int getScreenWidth(Context mContext) {
WindowManager manager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
manager.getDefaultDisplay().getMetrics(dm);
return dm.widthPixels;
}
// 获取屏幕高度
//
public static int getScreenHeight(Context mContext) {
WindowManager manager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
manager.getDefaultDisplay().getMetrics(dm);
return dm.heightPixels;
}
}

View File

@@ -0,0 +1,28 @@
package cc.winboll.studio.libaes.views;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:41:22
* @Describe AButton
*/
import android.content.Context;
import android.util.AttributeSet;
import cc.winboll.studio.libaes.R;
public class AButton extends android.widget.Button {
public static final String TAG = "AButton";
public AButton(Context context) {
super(context);
}
public AButton(Context context, AttributeSet attrs) {
super(context, attrs);
setBackground(context.getDrawable(R.drawable.btn_style));
}
public AButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
}

View File

@@ -0,0 +1,45 @@
package cc.winboll.studio.libaes.views;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:44:27
* @Describe ACard
*/
import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import cc.winboll.studio.libaes.R;
public class ACard extends LinearLayout {
public static final String TAG = "ACard";
public ACard(Context context) {
super(context);
}
public ACard(Context context, AttributeSet attrs) {
super(context, attrs);
setPadding(0 + 0 + 2 + 1, 0 + 0 + 2 + 1, 0 + 1 + 3 + 1, 0 + 2 + 3 + 1);
// 获得TypedArray
//TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AToolbar);
// 获得attrs.xml里面的属性值,格式为:名称_属性名,后面是默认值
//int colorBackgroud = a.getColor(R.styleable.ACard_backgroudColor, context.getColor(R.color.colorACardBackgroung));
//int centerColor = a.getColor(R.styleable.AToolbar_centerColor, context.getColor(R.color.colorAToolbarCenterColor));
//int endColor = a.getColor(R.styleable.AToolbar_endColor, context.getColor(R.color.colorAToolbarEndColor));
//float tSize = a.getDimension(R.styleable.CustomView_tSize, 35);
//p.setColor(tColor);
//p.setTextSize(tSize);
//Drawable drawable = context.getDrawable(R.drawable.frame_atoolbar);
setBackground(context.getDrawable(R.drawable.acard_frame_main));
// 返回一个绑定资源结束的信号给资源
//a.recycle();
}
public ACard(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
}

View File

@@ -0,0 +1,19 @@
package cc.winboll.studio.libaes.views;
/**
* @Author ZhanGSKen
* @Date 2023/05/30 11:30:07
*/
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;
public class ADrawerMenuListView extends ListView {
public static final String TAG = "ADrawerMenuListView";
public ADrawerMenuListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
}

View File

@@ -0,0 +1,117 @@
package cc.winboll.studio.libaes.views;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:46:30
* @Describe AOneHundredPercantClickToCommitSeekBar
*/
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.SeekBar;
public class AOHPCTCSeekBar extends SeekBar {
public static final String TAG = "AOHPCTCSeekBar";
// 可开始拉动的起始位置(百分比值)
static final int ENABLE_POST_PERCENT_X = 20;
// 最小拉动值,滑块拉动值要超过这个值,确定事件才会提交。
static final int TO_MIN_VALUE = 15;
// 外部接口对象,确定事件提交会调用该对象的方法
OnOHPCListener mOnOHPCListener;
// 是否从起点拉动的标志
boolean mIsStartTo = false;
// 拉动的滑动值
int mnTo = 0;
public void setOnOHPCListener(OnOHPCListener listener) {
mOnOHPCListener = listener;
}
public interface OnOHPCListener {
abstract void onOHPCommit();
}
public AOHPCTCSeekBar(Context context) {
super(context);
}
public AOHPCTCSeekBar(Context context, AttributeSet attrs) {
super(context, attrs);
//LogUtils.d(TAG, "AOHPCTCSeekBar(...)");
// 获得TypedArray
//TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AToolbar);
// 获得attrs.xml里面的属性值,格式为:名称_属性名,后面是默认值
//int colorBackgroud = a.getColor(R.styleable.ACard_backgroudColor, context.getColor(R.color.colorACardBackgroung));
//int centerColor = a.getColor(R.styleable.AToolbar_centerColor, context.getColor(R.color.colorAToolbarCenterColor));
//int endColor = a.getColor(R.styleable.AToolbar_endColor, context.getColor(R.color.colorAToolbarEndColor));
//float tSize = a.getDimension(R.styleable.CustomView_tSize, 35);
//p.setColor(tColor);
//p.setTextSize(tSize);
//Drawable drawable = context.getDrawable(R.drawable.frame_atoolbar);
//setBackground(context.getDrawable(R.drawable.acard_frame_main));
// 返回一个绑定资源结束的信号给资源
//a.recycle();
}
public AOHPCTCSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
//LogUtils.d(TAG, "ACTION_DOWN");
// 有效的拖动起始位置(ENABLE_POST_PERCENT_X)%
int nEnablePostX = ((getRight() - getLeft()) * ENABLE_POST_PERCENT_X / 100) + getLeft();
if ((getLeft() < event.getX())
&& (event.getX() < nEnablePostX)) {
//LogUtils.d(TAG, "event.getX() is " + Float.toString(event.getX()));
mIsStartTo = true;
return super.dispatchTouchEvent(event);
}
if (!mIsStartTo) {
resetView();
return false;
}
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
//LogUtils.d(TAG, "ACTION_MOVE");
if (mIsStartTo) {
mnTo++;
}
} else if (event.getAction() == MotionEvent.ACTION_UP) {
//LogUtils.d(TAG, Integer.toString(getProgress()));
// 提交100%确定事件
if ((getProgress() == 100) && (mnTo > TO_MIN_VALUE)) {
//LogUtils.d(TAG, "Commit mnTo is " + Integer.toString(mnTo));
mOnOHPCListener.onOHPCommit();
//resetView();
//return true;
}
resetView();
return false;
}
//LogUtils.d(TAG, "dispatchTouchEvent End");
return super.dispatchTouchEvent(event);
}
// 重置控件状态
//
void resetView() {
setProgress(0);
mnTo = 0;
mIsStartTo = false;
}
}

View File

@@ -0,0 +1,43 @@
package cc.winboll.studio.libaes.views;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:49:23
* @Describe AOneHundredPercantClickToStartCard
*/
import android.content.Context;
import android.util.AttributeSet;
public class AOHPCTSCard extends ACard {
public static final String TAG = "AOHPCTSCard";
public AOHPCTSCard(Context context) {
super(context);
}
public AOHPCTSCard(Context context, AttributeSet attrs) {
super(context, attrs);
//setPadding(0 + 0 + 2 + 1, 0 + 0 + 2 + 1, 0 + 1 + 3 + 1, 0 + 2 + 3 + 1);
// 获得TypedArray
//TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AToolbar);
// 获得attrs.xml里面的属性值,格式为:名称_属性名,后面是默认值
//int colorBackgroud = a.getColor(R.styleable.ACard_backgroudColor, context.getColor(R.color.colorACardBackgroung));
//int centerColor = a.getColor(R.styleable.AToolbar_centerColor, context.getColor(R.color.colorAToolbarCenterColor));
//int endColor = a.getColor(R.styleable.AToolbar_endColor, context.getColor(R.color.colorAToolbarEndColor));
//float tSize = a.getDimension(R.styleable.CustomView_tSize, 35);
//p.setColor(tColor);
//p.setTextSize(tSize);
//Drawable drawable = context.getDrawable(R.drawable.frame_atoolbar);
//setBackground(context.getDrawable(R.drawable.acard_frame_main));
// 返回一个绑定资源结束的信号给资源
//a.recycle();
}
public AOHPCTSCard(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
}

View File

@@ -0,0 +1,89 @@
package cc.winboll.studio.libaes.views;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:54:40
* @Describe ASupportToolbar
*/
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.util.AttributeSet;
import androidx.appcompat.widget.Toolbar;
import cc.winboll.studio.libaes.R;
import android.graphics.drawable.Drawable;
import androidx.core.content.ContextCompat;
import android.graphics.PorterDuff;
public class ASupportToolbar extends Toolbar {
public static final String TAG = "ASupportToolbar";
int mTitleTextColor;
int mStartColor;
int mCenterColor;
int mEndColor;
LayerDrawable ld;
GradientDrawable[] array = new GradientDrawable[3];
//private GradientDrawable gradientDrawable;
public ASupportToolbar(Context context) {
super(context);
}
public ASupportToolbar(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ASupportToolbar, R.attr.aSupportToolbar, 0);
mTitleTextColor = a.getColor(R.styleable.ASupportToolbar_attrASupportToolbarTitleTextColor, Color.GREEN);
mStartColor = a.getColor(R.styleable.ASupportToolbar_attrASupportToolbarStartColor, Color.BLUE);
mCenterColor = a.getColor(R.styleable.ASupportToolbar_attrASupportToolbarCenterColor, Color.RED);
mEndColor = a.getColor(R.styleable.ASupportToolbar_attrASupportToolbarEndColor, Color.YELLOW);
// 返回一个绑定资源结束的信号给资源
a.recycle();
notifyColorChange();
}
void notifyColorChange() {
// 工具栏描边
int nStroke = 5;
//分别为开始颜色,中间夜色,结束颜色
int colors0[] = { mEndColor , mCenterColor, mStartColor};
GradientDrawable gradientDrawable0;
array[2] = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, colors0);
gradientDrawable0 = array[2];
gradientDrawable0.setShape(GradientDrawable.RECTANGLE);
gradientDrawable0.setColors(colors0); //添加颜色组
gradientDrawable0.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
gradientDrawable0.setCornerRadius(20);
int colors1[] = { mCenterColor , mCenterColor, mCenterColor };
GradientDrawable gradientDrawable1;
array[1] = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, colors1);
gradientDrawable1 = array[1];
gradientDrawable1.setShape(GradientDrawable.RECTANGLE);
gradientDrawable1.setColors(colors1); //添加颜色组
gradientDrawable1.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
gradientDrawable1.setCornerRadius(20);
int colors2[] = { mEndColor, mCenterColor, mStartColor };
GradientDrawable gradientDrawable2;
array[0] = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, colors2);
gradientDrawable2 = array[0];
gradientDrawable2.setShape(GradientDrawable.RECTANGLE);
gradientDrawable2.setColors(colors2); //添加颜色组
gradientDrawable2.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
gradientDrawable2.setCornerRadius(20);
ld = new LayerDrawable(array); //参数为上面的Drawable数组
ld.setLayerInset(2, nStroke * 2, nStroke * 2, getWidth() + nStroke * 2, getHeight() + nStroke * 2);
ld.setLayerInset(1, nStroke, nStroke, getWidth() + nStroke, getHeight() + nStroke);
ld.setLayerInset(0, 0, 0, getWidth(), getHeight());
setBackgroundDrawable(ld);
setTitleTextColor(mTitleTextColor);
setSubtitleTextColor(mTitleTextColor);
}
}

View File

@@ -0,0 +1,55 @@
package cc.winboll.studio.libaes.views;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:56:38
* @Describe ATickProgressBar
*/
import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.widget.ProgressBar;
public class ATickProgressBar extends ProgressBar {
public static final String TAG = "ATickProgressBar";
int mnStepDistantce = 100 / 10;
int mnProgress = 0;
public ATickProgressBar(Context context) {
super(context);
}
public ATickProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
setProgress(50);
}
public int stepOnTick(int nStepDistantce) {
if (mnProgress < 100) {
int nProgressOld = mnProgress;
mnProgress += nStepDistantce;
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
;
}
}, 1000);
return nProgressOld;
} else {
return mnProgress;
}
}
/*@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int nWidthSize = MeasureSpec.getSize(widthMeasureSpec);
int nHeightSize = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(nWidthSize, nHeightSize);
}*/
}

View File

@@ -0,0 +1,92 @@
package cc.winboll.studio.libaes.views;
/**
* @Author ZhanGSKen@QQ.COM
* @Date 2024/07/16 01:58:01
* @Describe AToolbar
*/
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.util.AttributeSet;
import android.widget.Toolbar;
import cc.winboll.studio.libaes.R;
public class AToolbar extends Toolbar {
public static final String TAG = "AToolbar";
int mTitleTextColor;
int mStartColor;
int mCenterColor;
int mEndColor;
LayerDrawable ld;
GradientDrawable[] array = new GradientDrawable[3];
public AToolbar(Context context) {
super(context);
}
public AToolbar(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AToolbar, R.attr.aToolbar, 0);
mTitleTextColor = a.getColor(R.styleable.AToolbar_attrAToolbarTitleTextColor, Color.GREEN);
mStartColor = a.getColor(R.styleable.AToolbar_attrAToolbarStartColor, Color.BLUE);
mCenterColor = a.getColor(R.styleable.AToolbar_attrAToolbarCenterColor, Color.RED);
mEndColor = a.getColor(R.styleable.AToolbar_attrAToolbarEndColor, Color.YELLOW);
// 返回一个绑定资源结束的信号给资源
a.recycle();
notifyColorChange();
}
public AToolbar(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
void notifyColorChange() {
// 工具栏描边
int nStroke = 5;
//分别为开始颜色,中间夜色,结束颜色
int colors0[] = { mEndColor , mCenterColor, mStartColor};
GradientDrawable gradientDrawable0;
array[2] = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, colors0);
gradientDrawable0 = array[2];
gradientDrawable0.setShape(GradientDrawable.RECTANGLE);
gradientDrawable0.setColors(colors0); //添加颜色组
gradientDrawable0.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
gradientDrawable0.setCornerRadius(20);
int colors1[] = { mCenterColor , mCenterColor, mCenterColor };
GradientDrawable gradientDrawable1;
array[1] = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, colors1);
gradientDrawable1 = array[1];
gradientDrawable1.setShape(GradientDrawable.RECTANGLE);
gradientDrawable1.setColors(colors1); //添加颜色组
gradientDrawable1.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
gradientDrawable1.setCornerRadius(20);
int colors2[] = { mEndColor, mCenterColor, mStartColor };
GradientDrawable gradientDrawable2;
array[0] = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, colors2);
gradientDrawable2 = array[0];
gradientDrawable2.setShape(GradientDrawable.RECTANGLE);
gradientDrawable2.setColors(colors2); //添加颜色组
gradientDrawable2.setGradientType(GradientDrawable.LINEAR_GRADIENT);//设置线性渐变
gradientDrawable2.setCornerRadius(20);
ld = new LayerDrawable(array); //参数为上面的Drawable数组
ld.setLayerInset(2, nStroke * 2, nStroke * 2, getWidth() + nStroke * 2, getHeight() + nStroke * 2);
ld.setLayerInset(1, nStroke, nStroke, getWidth() + nStroke, getHeight() + nStroke);
ld.setLayerInset(0, 0, 0, getWidth(), getHeight());
setBackgroundDrawable(ld);
setTitleTextColor(mTitleTextColor);
setSubtitleTextColor(mTitleTextColor);
}
}

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXScale="0.1"
android:toXScale="1.0"
android:fromYScale="0.1"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="false"
android:duration="300" />
<set android:interpolator="@android:anim/decelerate_interpolator">
<scale
android:fromXScale="1.0"
android:toXScale="1.0"
android:fromYScale="1.0"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="700"
android:duration="100"
android:fillBefore="false" />
<rotate
android:fromDegrees="0"
android:toDegrees="0"
android:toYScale="0.0"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="700"
android:duration="100" />
</set>
</set>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXScale="0.1"
android:toXScale="1.0"
android:fromYScale="0.1"
android:toYScale="1.0"
android:pivotX="@dimen/dialogPivotX"
android:pivotY="@dimen/dialogPivotY"
android:fillAfter="false"
android:duration="500" />
</set>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXScale="1.0"
android:toXScale="1.0"
android:fromYScale="1.0"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="false"
android:duration="100" />
<set android:interpolator="@android:anim/decelerate_interpolator">
<scale
android:fromXScale="1.0"
android:toXScale="0.1"
android:fromYScale="1.0"
android:toYScale="0.1"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="700"
android:duration="100"
android:fillBefore="false" />
<rotate
android:fromDegrees="0"
android:toDegrees="0"
android:toYScale="0.0"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="700"
android:duration="100" />
</set>
</set>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
android:fromXScale="1.0"
android:toXScale="0.1"
android:fromYScale="1.0"
android:toYScale="0.1"
android:pivotX="@dimen/dialogPivotX"
android:pivotY="@dimen/dialogPivotY"
android:duration="500"
android:fillBefore="false" />
</set>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 边框阴影部分 -->
<!-- 相对边框的Offset设置(android:left, top, right, bottom) -->
<item
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:startColor="@color/colorACardShadow"
android:centerColor="@color/colorACardShadow"
android:endColor="@color/colorACardShadow"/>
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
<!-- 边框部分 -->
<item
android:left="0dp"
android:top="0dp"
android:right="1dp"
android:bottom="2dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:startColor="@color/colorACardFrame"
android:centerColor="@color/colorACardFrame"
android:endColor="@color/colorACardFrame"/>
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
<!-- 背景主体部分 -->
<item
android:left="2dp"
android:top="2dp"
android:right="3dp"
android:bottom="3dp">
<shape android:shape="rectangle" >
<gradient
android:type="linear"
android:angle="90"
android:startColor="@color/colorACardBackgroung"
android:centerColor="@color/colorACardBackgroung"
android:endColor="@color/colorACardBackgroung"/>
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 边框阴影部分 -->
<!-- 相对边框的Offset设置(android:left, top, right, bottom) -->
<item
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="2dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:startColor="?attr/attrAToolbarEndColor"
android:centerColor="?attr/attrAToolbarCenterColor"
android:endColor="?attr/attrAToolbarStartColor"/>
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
<!-- 边框部分 -->
<item
android:left="2dp"
android:top="2dp"
android:right="2dp"
android:bottom="4dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:startColor="?attr/attrAToolbarCenterColor"
android:centerColor="?attr/attrAToolbarCenterColor"
android:endColor="?attr/attrAToolbarCenterColor"/>
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
<!-- 背景主体部分 -->
<item
android:left="4dp"
android:top="4dp"
android:right="4dp"
android:bottom="6dp">
<shape android:shape="rectangle" >
<gradient
android:type="linear"
android:angle="90"
android:startColor="?attr/attrAToolbarStartColor"
android:centerColor="?attr/attrAToolbarCenterColor"
android:endColor="?attr/attrAToolbarEndColor"/>
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/pressed_shape" android:state_pressed="true"></item>
<item android:drawable="@drawable/default_shape"></item>
</selector>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<!-- 颜色填充方式绘画按钮 -->
<!--<solid android:color="?attr/colorPrimaryDark" />-->
<stroke
android:width="2dp"
android:color="?attr/colorPrimary" />
<corners android:radius="15dp" />
<!-- 颜色线性渐变方式绘画按钮 -->
<gradient
android:angle="270"
android:startColor="?attr/colorAccent"
android:centerColor="?attr/colorPrimary"
android:endColor="?attr/colorPrimaryDark"/>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" />
</shape>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M8,14V18L2,12L8,6V10H16V6L22,12L16,18V14H8Z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M13,18H11V10L7.5,13.5L6.08,12.08L12,6.16L17.92,12.08L16.5,13.5L13,10V18M12,2A10,10 0,0 1,22 12A10,10 0,0 1,12 22A10,10 0,0 1,2 12A10,10 0,0 1,12 2M12,4A8,8 0,0 0,4 12A8,8 0,0 0,12 20A8,8 0,0 0,20 12A8,8 0,0 0,12 4Z"/>
</vector>

View File

@@ -0,0 +1,43 @@
<?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>
<gradient
android:angle="270"
android:centerY="0.75"
android:startColor="@color/colorOHPCTSBackground"
android:centerColor="@color/colorOHPCTSBackground"
android:endColor="@color/colorOHPCTSBackground"/>
<corners android:radius="6dip"/>
</shape>
</item>
<!-- 第二进度条 -->
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<gradient
android:angle="270"
android:centerY="0.75"
android:startColor="@color/colorOHPCTSSecondaryProgress"
android:centerColor="@color/colorOHPCTSSecondaryProgress"
android:endColor="@color/colorOHPCTSSecondaryProgress"/>
<corners android:radius="6dip"/>
</shape>
</clip>
</item>
<!-- 第一进度条 -->
<item android:id="@android:id/progress">
<clip>
<shape>
<gradient
android:type="linear"
android:angle="90"
android:startColor="@color/colorOHPCTSProgress"
android:centerColor="@color/colorOHPCTSProgress"
android:endColor="@color/colorOHPCTSProgress"/>
<corners android:radius="6dip"/>
</shape>
</clip>
</item>
</layer-list>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<!-- 颜色填充方式绘画按钮 -->
<solid android:color="?attr/colorPrimaryDark" />
<!-- 边框 -->
<stroke
android:width="2dp"
android:color="?attr/colorPrimaryDark" />
<!-- 定义成圆角的 -->
<corners android:radius="15dp" />
<!-- 颜色线性渐变方式绘画按钮 -->
<!--<gradient
android:angle="270"
android:startColor="?attr/colorAccent"
android:centerColor="?attr/colorPrimary"
android:endColor="?attr/colorPrimaryDark"/>
-->
</shape>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 边框阴影部分 -->
<!-- 相对边框的Offset设置(android:left, top, right, bottom) -->
<item
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:startColor="@color/colorToastShadow"
android:centerColor="@color/colorToastShadow"
android:endColor="@color/colorToastShadow"/>
<corners
android:bottomLeftRadius="10dip"
android:bottomRightRadius="10dip"
android:topLeftRadius="10dip"
android:topRightRadius="10dip" />
</shape>
</item>
<!-- 边框部分 -->
<item
android:left="0dp"
android:top="0dp"
android:right="1dp"
android:bottom="2dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:startColor="@color/colorToastFrame"
android:centerColor="@color/colorToastFrame"
android:endColor="@color/colorToastFrame"/>
<corners
android:bottomLeftRadius="10dip"
android:bottomRightRadius="10dip"
android:topLeftRadius="10dip"
android:topRightRadius="10dip" />
</shape>
</item>
<!-- 背景主体部分 -->
<item
android:left="2dp"
android:top="2dp"
android:right="3dp"
android:bottom="3dp">
<shape android:shape="rectangle" >
<gradient
android:type="linear"
android:angle="90"
android:startColor="@color/colorToastBackgroung"
android:centerColor="@color/colorToastBackgroung"
android:endColor="@color/colorToastBackgroung"/>
<corners
android:bottomLeftRadius="10dip"
android:bottomRightRadius="10dip"
android:topLeftRadius="10dip"
android:topRightRadius="10dip" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<cc.winboll.studio.libaes.views.ASupportToolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/activitydrawerASupportToolbar1"/>
<androidx.drawerlayout.widget.DrawerLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/activitydrawerDrawerLayout1">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:id="@+id/activitydrawerLinearLayout1"/>
</LinearLayout>
<com.baoyz.widget.PullRefreshLayout
android:orientation="vertical"
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?attr/colorAccent"
android:choiceMode="singleChoice"
android:divider="#FFFFFF"
android:dividerHeight="1dp"
android:id="@+id/activitydrawerPullRefreshLayout1">
<cc.winboll.studio.libaes.views.DrawerMenuListView
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?attr/colorAccent"
android:choiceMode="singleChoice"
android:divider="#FFFFFF"
android:dividerHeight="1dp"
android:id="@+id/activitydrawerDrawerMenuListView1"/>
</com.baoyz.widget.PullRefreshLayout>
</androidx.drawerlayout.widget.DrawerLayout>
</LinearLayout>

View File

@@ -0,0 +1,58 @@
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<cc.winboll.studio.libaes.views.ASupportToolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/activitydrawerfragmentASupportToolbar1"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0">
<androidx.drawerlayout.widget.DrawerLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/activitydrawerfragmentDrawerLayout1">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/activitydrawerfragmentFrameLayout1"/>
<com.baoyz.widget.PullRefreshLayout
android:orientation="vertical"
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?attr/colorAccent"
android:choiceMode="singleChoice"
android:divider="#FFFFFF"
android:dividerHeight="1dp"
android:id="@+id/activitydrawerfragmentPullRefreshLayout1">
<cc.winboll.studio.libaes.views.ADrawerMenuListView
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?attr/colorAccent"
android:choiceMode="singleChoice"
android:divider="#FFFFFF"
android:dividerHeight="1dp"
android:id="@+id/activitydrawerfragmentDrawerMenuListView1"/>
</com.baoyz.widget.PullRefreshLayout>
</androidx.drawerlayout.widget.DrawerLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/activitylibraryFrameLayout1"/>
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SecondaryLibraryActivity"/>
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/activitytestaboutfragmentFrameLayout1"/>
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<cc.winboll.studio.libaes.views.ASupportToolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/activitytestasupporttoolbarASupportToolbar1"/>
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<cc.winboll.studio.libaes.views.AToolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/activitytestatoolbarAToolbar1"/>
</LinearLayout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Storage Path Dialog"/>
<EditText
android:layout_width="match_parent"
android:ems="10"
android:layout_height="wrap_content"
android:inputType="text"
android:autofillHints=""
android:hint="text 1"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:textAllCaps="false"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OK"
android:textAllCaps="false"
android:id="@+id/dialogstoragepathButton1"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AButton"/>
<cc.winboll.studio.libaes.views.AButton
android:layout_width="wrap_content"
android:layout_height="32dp"
android:text="确定"
android:id="@+id/fragmentabuttonAButton1"/>
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF0A9FA6">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SecondaryLibraryFragment"/>
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF0A9FA6">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TestFragment1"/>
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF0A9FA6">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TestFragment2"/>
</LinearLayout>

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AOHPCTCSeekBar"/>
<cc.winboll.studio.libaes.views.AOHPCTCSeekBar
android:layout_width="300dp"
android:layout_height="wrap_content"
android:id="@+id/fragmentviewpageAOHPCTCSeekBar1"/>
<androidx.viewpager.widget.ViewPager
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.0"
android:id="@+id/fragmentviewpageViewPager1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:orientation="horizontal"
android:gravity="center"
android:id="@+id/fragmentviewpageLinearLayout1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
tools:ignore="ContentDescription"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
tools:ignore="ContentDescription"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
tools:ignore="ContentDescription"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
tools:ignore="ContentDescription"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,28 @@
<?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="48dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_centerVertical="true"
android:layout_width="40dp"
android:layout_height="40dp"
android:focusable="false"
android:id="@+id/listviewdrawermenuImageView1"
tools:ignore="ContentDescription"/>
<TextView
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_toEndOf="@id/listviewdrawermenuImageView1"
android:textSize="18sp"
android:text="AndroidGoodies"
android:id="@+id/listviewdrawermenuTextView1"/>
</RelativeLayout>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="@drawable/toast_frame"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:id="@+id/customtoastTextView1"
android:background="#FFFFFFFF"
android:gravity="center_horizontal"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#FFE8E8E8"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:text="Text"
android:id="@+id/customtoastTextView2"
android:background="#FFFFFFFF"
android:gravity="center_horizontal"/>
</LinearLayout>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ACard"/>
<cc.winboll.studio.libaes.views.ACard
android:layout_width="200dp"
android:layout_height="200dp"/>
</LinearLayout>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AOHPCTSCard"/>
<cc.winboll.studio.libaes.views.AOHPCTSCard
android:layout_width="100dp"
android:layout_height="100dp"/>
</LinearLayout>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AOHPCTCSeekBar"/>
</LinearLayout>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ATickProgressBar"/>
<cc.winboll.studio.libaes.views.ATickProgressBar
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="200dp"
android:layout_height="200dp"/>
<ProgressBar
android:layout_width="200dp"
android:layout_height="200dp"/>
</LinearLayout>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:title="@string/text_AppTheme">
<menu >
<item
android:id="@+id/item_defaulttheme"
android:title="@string/text_DefaultTheme"/>
<item
android:id="@+id/item_depththeme"
android:title="@string/text_DepthTheme"/>
<item
android:id="@+id/item_skytheme"
android:title="@string/text_SkyTheme"/>
<item
android:id="@+id/item_goldentheme"
android:title="@string/text_GoldenTheme"/>
<item
android:id="@+id/item_memortheme"
android:title="@string/text_MemorTheme"/>
<item
android:id="@+id/item_taotheme"
android:title="@string/text_TaoTheme"/>
</menu>
</item>
</menu>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:title="Develop">
<menu >
<item
android:id="@+id/item_testappcrash"
android:title="TestAppCrash"/>
</menu>
</item>
<item
android:id="@+id/item_about"
android:title="About"/>
</menu>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/item_log"
android:title="LogActivity"/>
<item
android:id="@+id/item_colordialog"
android:title="ColorDialog"/>
<item
android:id="@+id/item_dialogstoragepath"
android:title="StoragePathDialog"/>
<item
android:id="@+id/item_localfileselectdialog"
android:title="LocalFileSelectDialog"/>
<item
android:id="@+id/item_atoolbar"
android:title="Test AToolbar"/>
<item
android:id="@+id/item_asupporttoolbar"
android:title="Test ASupportToolbar"/>
<item
android:id="@+id/item_atoast"
android:title="Test AToast"/>
<item
android:id="@+id/item_secondarylibraryactivity"
android:title="Test SecondaryLibraryActivity"/>
<item
android:id="@+id/item_drawerfragmentactivity"
android:title="Test DrawerFragmentActivity"/>
</menu>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/item_test"
android:title="TestItem"/>
</menu>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="lib_name">libaes</string>
<string name="lib_description">云宝APP应用安卓元素类库示例。源码仅供调试参考请勿直接引用。(WinBoll APP application Android element class library example. The source is just for demo debug test, Do not quote directly.)</string>
<string name="lib_home">https://winboll.cc/aes</string>
<string name="text_about">关于</string>
<string name="text_AppTheme">应用主题</string>
<string name="text_DefaultTheme">默认主题</string>
<string name="text_DepthTheme">深奥主题</string>
<string name="text_SkyTheme">天空主题</string>
<string name="text_GoldenTheme">辉煌主题</string>
<string name="text_MemorTheme">梦箩主题</string>
<string name="text_TaoTheme">黑白主题</string>
</resources>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="colorTextColor" format="color" />
<attr name="colorPrimary" format="color" />
<attr name="colorPrimaryDark" format="color" />
<attr name="colorAccent" format="color" />
<attr name="aToolbar" format="reference"/>
<attr name="attrAToolbarTitleTextColor" format="color" />
<attr name="attrAToolbarStartColor" format="color" />
<attr name="attrAToolbarCenterColor" format="color" />
<attr name="attrAToolbarEndColor" format="color" />
<declare-styleable name="AToolbar">
<attr name="attrAToolbarTitleTextColor"/>
<attr name="attrAToolbarStartColor"/>
<attr name="attrAToolbarCenterColor"/>
<attr name="attrAToolbarEndColor"/>
</declare-styleable>
<attr name="aSupportToolbar" format="reference"/>
<attr name="attrASupportToolbarTitleTextColor" format="color" />
<attr name="attrASupportToolbarStartColor" format="color" />
<attr name="attrASupportToolbarCenterColor" format="color" />
<attr name="attrASupportToolbarEndColor" format="color" />
<declare-styleable name="ASupportToolbar">
<attr name="attrASupportToolbarTitleTextColor"/>
<attr name="attrASupportToolbarStartColor"/>
<attr name="attrASupportToolbarCenterColor"/>
<attr name="attrASupportToolbarEndColor"/>
</declare-styleable>
<attr name="ActionSheetList" format="reference"/>
<!--<declare-styleable name="AToolbarStyle">
<attr name="attrAToolbarStartColor" format="color" />
<attr name="attrAToolbarCenterColor" format="color" />
<attr name="attrAToolbarEndColor" format="color" />
</declare-styleable>-->
<declare-styleable name="ACard">
<attr name="attrACardBackgroudColor" format="color" />
<attr name="attrACardShadowColor" format="color" />
<attr name="attrACardFrameColor" format="color" />
</declare-styleable>
<declare-styleable name="ATickProgressBar">
<attr name="attrATickProgressBarBackgroudColor" format="color" />
<attr name="attrATickProgressBarProgressColor" format="color" />
</declare-styleable>
<declare-styleable name="OneHundredPercantClickToSendProgressBar">
<attr name="attrOHPCTSBackgroundColor" format="color" />
<attr name="attrOHPCTSSecondaryProgressColor" format="color" />
<attr name="attrOHPCTSProgressColor" format="color" />
</declare-styleable>
</resources>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 默认方案 -->
<color name="colorPrimary">#FF03AB4E</color>
<color name="colorPrimaryDark">#FF027C39</color>
<color name="colorAccent">#FF3DDC84</color>
<color name="colorToastFrame">#FFA9A9A9</color>
<color name="colorToastShadow">#FF000000</color>
<color name="colorToastBackgroung">#FFFFFFFF</color>
<color name="colorAToolbarStartColor">#FF7D3F12</color>
<color name="colorAToolbarCenterColor">#FFCC6E2B</color>
<color name="colorAToolbarEndColor">#FFF4B98F</color>
<color name="colorACardShadow">@color/colorPrimaryDark</color>
<color name="colorACardFrame">@color/colorPrimary</color>
<color name="colorACardBackgroung">@color/colorAccent</color>
<color name="colorATickProgressBarBackgroung">@color/colorAccent</color>
<color name="colorATickProgressBarProgress">@color/colorPrimary</color>
<color name="colorOHPCTSBackground">@color/colorAccent</color>
<color name="colorOHPCTSSecondaryProgress">@color/colorPrimary</color>
<color name="colorOHPCTSProgress">@color/colorPrimaryDark</color>
<!-- -->
<!-- 调试方案
<color name="colorPrimary">#FF727272</color>
<color name="colorPrimaryDark">#FF444444</color>
<color name="colorAccent">#FF9EA19F</color>
<color name="colorAToolbarStartColor">#FF4776EB</color>
<color name="colorAToolbarCenterColor">#FF0D4BE7</color>
<color name="colorAToolbarEndColor">#FF8FA7E3</color>
<color name="colorACardShadow">#FF22A200</color>
<color name="colorACardFrame">#FF3FCC19</color>
<color name="colorACardBackgroung">#FF88F16B</color>
<color name="colorATickProgressBarBackgroung">#FF6DC4E2</color>
<color name="colorATickProgressBarProgress">#FF22B0E1</color>
-->
</resources>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--<item name="top_weight" type="dimen" format="integer">5</item>
要在xml中引用上述定义的dimens可以使用@dimen/text_line_spacing。
要在代码中引用上述定义的dimens可以使用如下代码。
TypedValue outValue = new TypedValue();
getResources().getValue(R.dimen.text_line_spacing, outValue, true);
float value = outValue.getFloat();
注意不能通过getResources().getDimension(R.dimen.text_line_spacing);方式来引用如果用这种方式引用上述方法定义的dimens编译时不会报错但是运行时会抛出NotFoundException。
参考https://blog.csdn.net/qluojieq/article/details/49591535?app_version=5.15.7&code=app_1562916241&csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%2249591535%22%2C%22source%22%3A%22weixin_38986226%22%7D&uLinkId=usr1mkqgl919blen&utm_source=app
-->
<item name="dialogPivotX" type="dimen" format="integer">900</item>
<item name="dialogPivotY" type="dimen" format="integer">-900</item>
<!--<item name="buttonHeight" type="dimen">100px</item>-->
</resources>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="lib_name">libaes</string>
<string name="lib_description">云宝APP应用安卓元素类库示例。源码仅供调试参考请勿直接引用。(WinBoll APP application Android element class library example. The source is just for demo debug test, Do not quote directly.)</string>
<string name="lib_home">https://winboll.cc/libaes</string>
<string name="text_about">About</string>
<string name="text_AppTheme">AppTheme</string>
<string name="text_DefaultTheme">DefaultTheme</string>
<string name="text_DepthTheme">DepthTheme</string>
<string name="text_SkyTheme">SkyTheme</string>
<string name="text_GoldenTheme">GoldenTheme</string>
<string name="text_MemorTheme">MemorTheme</string>
<string name="text_TaoTheme">TaoTheme</string>
</resources>

View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AESTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorTextColor">#FF000000</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColor">#FF000000</item>
<item name="aToolbar">@style/AESAToolbar</item>
<item name="aSupportToolbar">@style/AESASupportToolbar</item>
</style>
<style name="AESAToolbar">
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="AESASupportToolbar">
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="DefaultAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorTextColor">#FF000000</item>
<item name="colorPrimary">#FF03AB4E</item>
<item name="colorPrimaryDark">#FF027C39</item>
<item name="colorAccent">#FF3DDC84</item>
<item name="android:textColor">#FF000000</item>
<item name="aToolbar">@style/DefaultAToolbar</item>
<item name="aSupportToolbar">@style/DefaultASupportToolbar</item>
</style>
<style name="DefaultAToolbar">
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="DefaultASupportToolbar">
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="DepthAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorTextColor">#FF000000</item>
<item name="colorPrimary">#FF2566FE</item>
<item name="colorPrimaryDark">#FF1359FF</item>
<item name="colorAccent">#FF8BAEFF</item>
<item name="android:textColor">#FF000000</item>
<item name="aToolbar">@style/DepthAToolbar</item>
<item name="aSupportToolbar">@style/DepthASupportToolbar</item>
</style>
<style name="DepthAToolbar">
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="DepthASupportToolbar">
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="SkyAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorTextColor">#FF000000</item>
<item name="colorPrimary">#FF1E98D4</item>
<item name="colorPrimaryDark">#FF046A9C</item>
<item name="colorAccent">#FF8CD9FF</item>
<item name="android:textColor">#FF000000</item>
<item name="aToolbar">@style/SkyAToolbar</item>
<item name="aSupportToolbar">@style/SkyASupportToolbar</item>
</style>
<style name="SkyAToolbar">
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="SkyASupportToolbar">
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="GoldenAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorTextColor">#FF000000</item>
<item name="colorPrimary">#FFFFE22A</item>
<item name="colorPrimaryDark">#FFAE9600</item>
<item name="colorAccent">#FFFFED78</item>
<item name="android:textColor">#FF000000</item>
<item name="aToolbar">@style/GoldenAToolbar</item>
<item name="aSupportToolbar">@style/GoldenASupportToolbar</item>
</style>
<style name="GoldenAToolbar">
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="GoldenASupportToolbar">
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="MemorAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorTextColor">#FF000000</item>
<item name="colorPrimary">#FFCE1ED4</item>
<item name="colorPrimaryDark">#FFB500BC</item>
<item name="colorAccent">#FFE653EB</item>
<item name="android:textColor">#FF000000</item>
<item name="aToolbar">@style/MemorAToolbar</item>
<item name="aSupportToolbar">@style/MemorASupportToolbar</item>
</style>
<style name="MemorAToolbar">
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="MemorASupportToolbar">
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="TaoAESTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorTextColor">#FF000000</item>
<item name="colorPrimary">#FF9F9F9F</item>
<item name="colorPrimaryDark">#FF5E5E5E</item>
<item name="colorAccent">#FFD9D9D9</item>
<item name="android:textColor">#FF000000</item>
<item name="aToolbar">@style/TaoAToolbar</item>
<item name="aSupportToolbar">@style/TaoASupportToolbar</item>
</style>
<style name="TaoAToolbar">
<item name="attrAToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrAToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrAToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrAToolbarEndColor">?attr/colorAccent</item>
</style>
<style name="TaoASupportToolbar">
<item name="attrASupportToolbarTitleTextColor">?attr/colorTextColor</item>
<item name="attrASupportToolbarStartColor">?attr/colorPrimaryDark</item>
<item name="attrASupportToolbarCenterColor">?attr/colorPrimary</item>
<item name="attrASupportToolbarEndColor">?attr/colorAccent</item>
</style>
<!--<style name="AToolbar">
<item name="attrAToolbarTitleTextColor">#FF2DDA27</item>
<item name="attrAToolbarStartColor">#FF2DDA27</item>
<item name="attrAToolbarCenterColor">#FF2DDA27</item>
<item name="attrAToolbarEndColor">#FF2DDA27</item>
</style>-->
<!--对话框的样式-->
<style name="NormalDialogStyle">
<!--对话框背景 -->
<item name="android:windowBackground">@android:color/transparent</item>
<!--边框 -->
<item name="android:windowFrame">@null</item>
<!--没有标题 -->
<item name="android:windowNoTitle">true</item>
<!-- 是否浮现在Activity之上 -->
<item name="android:windowIsFloating">true</item>
<!--背景透明 -->
<item name="android:windowIsTranslucent">false</item>
<!-- 是否有覆盖 -->
<item name="android:windowContentOverlay">@null</item>
<!--进出的显示动画 -->
<item name="android:windowAnimationStyle">@style/cornerDialogAnim</item>
<!--背景变暗-->
<item name="android:backgroundDimEnabled">true</item>
</style>
<!--对话框动画,中间弹出-->
<style name="centerDialogAnim" parent="android:Animation">
<item name="@android:windowEnterAnimation">@anim/normal_dialog_enter_center</item>
<item name="@android:windowExitAnimation">@anim/normal_dialog_exit_center</item>
</style>
<!--对话框动画,角落弹出-->
<style name="cornerDialogAnim" parent="android:Animation">
<item name="@android:windowEnterAnimation">@anim/normal_dialog_enter_corner</item>
<item name="@android:windowExitAnimation">@anim/normal_dialog_exit_corner</item>
</style>
</resources>