diff --git a/README.md b/README.md index f75c311a..522104c0 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Please read the [instruction document](https://github.com/xuexiangjys/XUI/wiki) | WeChat public number | juejin | zhihu | CSDN | jianshu | segmentfault | bilibili | toutiao |---------|---------|--------- |---------|---------|---------|---------|---------| -| [我的Android开源之旅](https://ss.im5i.com/2021/06/14/6tqAU.png) | [Click me](https://juejin.im/user/598feef55188257d592e56ed/posts) | [Click me](https://www.zhihu.com/people/xuexiangjys/posts) | [Click me](https://xuexiangjys.blog.csdn.net/) | [Click me](https://www.jianshu.com/u/6bf605575337) | [Click me](https://segmentfault.com/u/xuexiangjys) | [Click me](https://space.bilibili.com/483850585) | [Click me](https://img.rruu.net/image/5ff34ff7b02dd) +| [我的Android开源之旅](https://t.1yb.co/Irse) | [Click me](https://juejin.im/user/598feef55188257d592e56ed/posts) | [Click me](https://www.zhihu.com/people/xuexiangjys/posts) | [Click me](https://xuexiangjys.blog.csdn.net/) | [Click me](https://www.jianshu.com/u/6bf605575337) | [Click me](https://segmentfault.com/u/xuexiangjys) | [Click me](https://space.bilibili.com/483850585) | [Click me](https://img.rruu.net/image/5ff34ff7b02dd) ## Rapid integration of X-Library @@ -80,7 +80,7 @@ allprojects { dependencies { ... //androidx project - implementation 'com.github.xuexiangjys:XUI:1.1.9' + implementation 'com.github.xuexiangjys:XUI:1.2.0' implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'androidx.recyclerview:recyclerview:1.2.1' diff --git a/README_ZH.md b/README_ZH.md index 582e1137..6a86596e 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -26,7 +26,7 @@ | 公众号 | 掘金 | 知乎 | CSDN | 简书 | 思否 | 哔哩哔哩 | 今日头条 |---------|---------|--------- |---------|---------|---------|---------|---------| -| [我的Android开源之旅](https://ss.im5i.com/2021/06/14/6tqAU.png) | [点我](https://juejin.im/user/598feef55188257d592e56ed/posts) | [点我](https://www.zhihu.com/people/xuexiangjys/posts) | [点我](https://xuexiangjys.blog.csdn.net/) | [点我](https://www.jianshu.com/u/6bf605575337) | [点我](https://segmentfault.com/u/xuexiangjys) | [点我](https://space.bilibili.com/483850585) | [点我](https://img.rruu.net/image/5ff34ff7b02dd) +| [我的Android开源之旅](https://t.1yb.co/Irse) | [点我](https://juejin.im/user/598feef55188257d592e56ed/posts) | [点我](https://www.zhihu.com/people/xuexiangjys/posts) | [点我](https://xuexiangjys.blog.csdn.net/) | [点我](https://www.jianshu.com/u/6bf605575337) | [点我](https://segmentfault.com/u/xuexiangjys) | [点我](https://space.bilibili.com/483850585) | [点我](https://img.rruu.net/image/5ff34ff7b02dd) ## X系列库快速集成 @@ -78,7 +78,7 @@ allprojects { dependencies { ... //androidx项目 - implementation 'com.github.xuexiangjys:XUI:1.1.9' + implementation 'com.github.xuexiangjys:XUI:1.2.0' implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'androidx.recyclerview:recyclerview:1.2.1' @@ -170,23 +170,23 @@ protected void attachBaseContext(Context newBase) { ### 演示程序截图 -![1_splash.png](https://ss.im5i.com/2021/06/14/6uDhR.png)   ![2_main.png](https://ss.im5i.com/2021/06/14/6uzmO.png)   ![3_about.png](https://ss.im5i.com/2021/06/14/6uaJd.png)   +![1_splash.png](./art/1_splash.png)   ![2_main.png](./art/2_main.png)   ![3_about.png](./art/3_about.png)   -![4_menu.png](https://ss.im5i.com/2021/06/14/6u4n4.png)   ![5_dialog.png](https://ss.im5i.com/2021/06/14/6upMW.png)   ![6_bottom_dialog.png](https://ss.im5i.com/2021/06/14/6uMdG.png)   +![4_menu.png](./art/4_menu.png)   ![5_dialog.png](./art/5_dialog.png)   ![6_bottom_dialog.png](./art/6_bottom_dialog.png)   -![7_picker.png](https://ss.im5i.com/2021/06/14/6uOWz.png)   ![8_webview.png](https://ss.im5i.com/2021/06/14/6uk05.png)  ![9_flowlayout.png](https://ss.im5i.com/2021/06/14/65FS6.png)   +![7_picker.png](./art/7_picker.png)   ![8_webview.png](./art/8_webview.png)  ![9_flowlayout.png](./art/9_flowlayout.png)   -![10_ninegrid.png](https://ss.im5i.com/2021/06/14/65Qt8.png)   ![11_radius_imageview.png](https://ss.im5i.com/2021/06/14/65hxU.png)   ![12_badge_view.png](https://ss.im5i.com/2021/06/14/65Cww.png)   +![10_ninegrid.png](./art/10_ninegrid.png)   ![11_radius_imageview.png](./art/11_radius_imageview.png)   ![12_badge_view.png](./art/12_badge_view.png)   -![13_tabview.png](https://ss.im5i.com/2021/06/14/65qJZ.png)   ![14_citypicker.png](https://ss.im5i.com/2021/06/14/65voJ.png)   ![15_refresh_layout.png](https://ss.im5i.com/2021/06/14/656O1.png)   +![13_tabview.png](./art/13_tabview.png)   ![14_citypicker.png](./art/14_citypicker.png)   ![15_refresh_layout.png](./art/15_refresh_layout.png)   -![16_spinner.png](https://ss.im5i.com/2021/06/14/65Sdn.png)   +![16_spinner.png](./art/16_spinner.png)   ### Demo下载 > 演示程序大概18M(主要是demo中集成了一个小视频拍摄的库比较大,大约13M左右,而XUI库目前只有644k大小),项目比较大,推荐使用蒲公英下载。 -![xui_size.png](https://ss.im5i.com/2021/06/14/65rcS.png) +![xui_size.png](./art/xui_size.png) #### 蒲公英下载 @@ -194,13 +194,13 @@ protected void attachBaseContext(Context newBase) { [![蒲公英](https://img.shields.io/badge/downloads-蒲公英-blue.svg)](https://www.pgyer.com/XUIDemo) -[![download_pugongying.png](https://ss.im5i.com/2021/06/14/65VuP.png)](https://www.pgyer.com/XUIDemo) +[![download_pugongying.png](./art/download_pugongying.png)](https://www.pgyer.com/XUIDemo) #### Github下载 [![Github](https://img.shields.io/badge/downloads-Github-blue.svg)](https://github.com/xuexiangjys/XUI/blob/master/apk/xuidemo.apk?raw=true) -[![download_github.png](https://ss.im5i.com/2021/06/14/65PS2.png)](https://github.com/xuexiangjys/XUI/blob/master/apk/xuidemo.apk?raw=true) +[![download_github.png](./art/download_github.png)](https://github.com/xuexiangjys/XUI/blob/master/apk/xuidemo.apk?raw=true) ## 贡献代码 @@ -240,7 +240,7 @@ protected void attachBaseContext(Context newBase) { > 你的打赏是我维护的动力,我将会列出所有打赏人员的清单在下方作为凭证,打赏前请留下打赏项目的备注! -![pay.png](https://ss.im5i.com/2021/06/14/6twG6.png) +![pay.png](https://raw.githubusercontent.com/xuexiangjys/Resource/master/img/pay/pay.png) 感谢下面小伙伴的打赏: @@ -332,4 +332,4 @@ X*? | 18.88¥ | 微信 [![](https://img.shields.io/badge/XUI开源交流3群-1090612354-blue.svg)](https://qm.qq.com/cgi-bin/qm/qr?k=nOY3GGJY-jiwzhQpR8E06G-yrOUsxCP1) -![](https://ss.im5i.com/2021/06/14/65yoL.jpg) \ No newline at end of file +![](https://s1.ax1x.com/2022/04/27/LbGMJH.jpg) \ No newline at end of file diff --git a/apk/xuidemo.apk b/apk/xuidemo.apk index b1f475a3..03d90a99 100644 Binary files a/apk/xuidemo.apk and b/apk/xuidemo.apk differ diff --git a/app/build.gradle b/app/build.gradle index be974651..ccde0d5f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ android { applicationId "com.xuexiang.xuidemo" minSdkVersion 17 targetSdkVersion build_versions.target_sdk - versionCode 20 - versionName "1.1.9" + versionCode 21 + versionName "1.2.0" multiDexEnabled true vectorDrawables.useSupportLibrary = true @@ -103,8 +103,8 @@ dependencies { implementation 'com.github.bumptech.glide:glide:4.12.0' // XUI框架 -// implementation project(':xui_lib') - implementation 'com.github.xuexiangjys:XUI:1.1.9' + implementation project(':xui_lib') +// implementation 'com.github.xuexiangjys:XUI:1.1.9' // implementation 'com.qmuiteam:qmui:1.2.0' // 工具类 @@ -113,8 +113,8 @@ dependencies { // 切片 implementation 'com.github.xuexiangjys.XAOP:xaop-runtime:1.1.0' // 页面路由 - implementation 'com.github.xuexiangjys.XRouter:xrouter-runtime:1.0.1' - annotationProcessor 'com.github.xuexiangjys.XRouter:xrouter-compiler:1.0.1' + implementation 'com.github.xuexiangjys.XRouter:xrouter-runtime:1.1.0' + annotationProcessor 'com.github.xuexiangjys.XRouter:xrouter-compiler:1.1.0' // XPage页面框架 implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.2.0' annotationProcessor project(':widget_compiler') @@ -168,7 +168,7 @@ dependencies { implementation 'com.yarolegovich:sliding-root-nav:1.1.0' // XQRCode二维码扫描 - implementation 'com.github.xuexiangjys:XQRCode:1.1.0' + implementation 'com.github.xuexiangjys:XQRCode:1.1.1' // CityPicker implementation "com.github.xuexiangjys:CityPicker:1.0.2" // XFloatView悬浮窗口 @@ -199,7 +199,7 @@ dependencies { implementation 'com.alibaba.android:ultraviewpager:1.0.7.8' implementation 'com.alibaba.android:tangram:3.3.6' // 版本更新 - implementation 'com.github.xuexiangjys:XUpdate:2.1.1' + implementation 'com.github.xuexiangjys:XUpdate:2.1.3' implementation 'com.zhy:okhttputils:2.6.2' implementation deps.gson implementation deps.okhttp3 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 50d6379a..e56cd834 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -45,6 +45,7 @@ @@ -92,6 +93,7 @@ @@ -215,7 +218,9 @@ - + diff --git a/app/src/main/java/com/xuexiang/xuidemo/DemoDataProvider.java b/app/src/main/java/com/xuexiang/xuidemo/DemoDataProvider.java index eb3d0e18..923e69ee 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/DemoDataProvider.java +++ b/app/src/main/java/com/xuexiang/xuidemo/DemoDataProvider.java @@ -79,7 +79,7 @@ public static List getGridItems(Context context) { private static List getGridItems(Context context, int titleArrayId, int iconArrayId) { List list = new ArrayList<>(); - String[] titles = ResUtils.getStringArray(titleArrayId); + String[] titles = ResUtils.getStringArray(context, titleArrayId); Drawable[] icons = ResUtils.getDrawableArray(context, iconArrayId); for (int i = 0; i < titles.length; i++) { list.add(new AdapterItem(titles[i], icons[i])); diff --git a/app/src/main/java/com/xuexiang/xuidemo/activity/MainActivity.java b/app/src/main/java/com/xuexiang/xuidemo/activity/MainActivity.java index 22b79c7e..2074f83b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/activity/MainActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/activity/MainActivity.java @@ -36,7 +36,7 @@ import com.xuexiang.xuidemo.utils.SettingSPUtils; import com.xuexiang.xuidemo.utils.TokenUtils; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xuidemo.widget.GuideTipsDialog; import com.xuexiang.xutil.common.ClickUtils; import com.xuexiang.xutil.system.DeviceUtils; @@ -92,7 +92,7 @@ protected void onCreate(Bundle savedInstanceState) { } private void initData() { - mMenuTitles = ResUtils.getStringArray(R.array.menu_titles); + mMenuTitles = ResUtils.getStringArray(this, R.array.menu_titles); mMenuIcons = ResUtils.getDrawableArray(this, R.array.menu_icons); } @@ -183,7 +183,7 @@ public boolean isMenuOpen() { private void initSlidingMenu(Bundle savedInstanceState) { mSlidingRootNav = new SlidingRootNavBuilder(this) - .withGravity(ResUtils.isRtl() ? SlideGravity.RIGHT : SlideGravity.LEFT) + .withGravity(ResUtils.isRtl(this) ? SlideGravity.RIGHT : SlideGravity.LEFT) .withMenuOpened(false) .withContentClickableWhenMenuOpened(false) .withSavedState(savedInstanceState) diff --git a/app/src/main/java/com/xuexiang/xuidemo/activity/SettingsActivity.java b/app/src/main/java/com/xuexiang/xuidemo/activity/SettingsActivity.java index dc346cef..25918453 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/activity/SettingsActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/activity/SettingsActivity.java @@ -33,7 +33,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.AppCompatPreferenceActivity; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; /** * 设置页面 diff --git a/app/src/main/java/com/xuexiang/xuidemo/activity/TranslucentActivity.java b/app/src/main/java/com/xuexiang/xuidemo/activity/TranslucentActivity.java index 2f202968..faa4893e 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/activity/TranslucentActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/activity/TranslucentActivity.java @@ -9,7 +9,7 @@ import com.xuexiang.xui.widget.banner.widget.banner.SimpleImageBanner; import com.xuexiang.xuidemo.DemoDataProvider; import com.xuexiang.xuidemo.R; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.ButterKnife; diff --git a/app/src/main/java/com/xuexiang/xuidemo/adapter/RefreshHeadViewAdapter.java b/app/src/main/java/com/xuexiang/xuidemo/adapter/RefreshHeadViewAdapter.java index b4a0b187..4d1ba2d9 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/adapter/RefreshHeadViewAdapter.java +++ b/app/src/main/java/com/xuexiang/xuidemo/adapter/RefreshHeadViewAdapter.java @@ -8,7 +8,7 @@ import com.xuexiang.xui.widget.banner.widget.banner.BannerItem; import com.xuexiang.xui.widget.banner.widget.banner.SimpleImageBanner; import com.xuexiang.xuidemo.R; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/adapter/UltraPagerAdapter.java b/app/src/main/java/com/xuexiang/xuidemo/adapter/UltraPagerAdapter.java index 2eaa7be7..7e9c8f6f 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/adapter/UltraPagerAdapter.java +++ b/app/src/main/java/com/xuexiang/xuidemo/adapter/UltraPagerAdapter.java @@ -17,6 +17,7 @@ package com.xuexiang.xuidemo.adapter; +import android.content.Context; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.text.TextUtils; @@ -66,11 +67,11 @@ public class UltraPagerAdapter extends PagerAdapter { private RecyclerViewHolder.OnItemClickListener mOnItemClickListener; - public UltraPagerAdapter(List list, float scale) { + public UltraPagerAdapter(@NonNull Context context, List list, float scale) { if (list != null && !list.isEmpty()) { mData.addAll(list); } - mPlaceHolder = new ColorDrawable(ResUtils.getColor(R.color.default_image_banner_placeholder_color)); + mPlaceHolder = new ColorDrawable(ResUtils.getColor(context, R.color.default_image_banner_placeholder_color)); mEnableCache = true; mScale = scale; } diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/BaseActivity.java b/app/src/main/java/com/xuexiang/xuidemo/base/BaseActivity.java index 51611a17..3404f008 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/BaseActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/BaseActivity.java @@ -119,7 +119,7 @@ protected void registerSlideBack() { if (isSupportSlideBack()) { SlideBack.withFixSize(this) .haveScroll(true) - .edgeMode(ResUtils.isRtl() ? SlideBack.EDGE_RIGHT : SlideBack.EDGE_LEFT) + .edgeMode(ResUtils.isRtl(this) ? SlideBack.EDGE_RIGHT : SlideBack.EDGE_LEFT) .callBack(this::popPage) .register(); } diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/BaseFragment.java b/app/src/main/java/com/xuexiang/xuidemo/base/BaseFragment.java index c671fb56..853bd56e 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/BaseFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/BaseFragment.java @@ -53,7 +53,7 @@ protected TitleBar initTitle() { @MemoryCache private Drawable getNavigationBackDrawable(int navigationBackId) { - return DrawableUtils.getSupportRTLDrawable(ThemeUtils.resolveDrawable(getContext(), navigationBackId)); + return DrawableUtils.getSupportRTLDrawable(getContext(), ThemeUtils.resolveDrawable(getContext(), navigationBackId)); } public IMessageLoader getMessageLoader() { diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/BaseHomeFragment.java b/app/src/main/java/com/xuexiang/xuidemo/base/BaseHomeFragment.java index 0e46c966..82eb5f52 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/BaseHomeFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/BaseHomeFragment.java @@ -73,7 +73,7 @@ public void performAction(View view) { @Override public int rightPadding() { - return DensityUtils.dp2px(10); + return DensityUtils.dp2px(getContext(), 10); } }); titleBar.addAction(new TitleBar.ImageAction(R.drawable.icon_action_about) { @@ -97,7 +97,7 @@ protected void initViews() { } private void initRecyclerView() { - WidgetUtils.initGridRecyclerView(mRecyclerView, 3, DensityUtils.dp2px(2), ThemeUtils.resolveColor(getContext(), R.attr.xui_config_color_separator_light, ResUtils.getColor(R.color.xui_config_color_separator_light_phone))); + WidgetUtils.initGridRecyclerView(mRecyclerView, 3, DensityUtils.dp2px(getContext(), 2), ThemeUtils.resolveColor(getContext(), R.attr.xui_config_color_separator_light, ResUtils.getColor(getContext(), R.color.xui_config_color_separator_light_phone))); WidgetItemAdapter mWidgetItemAdapter = new WidgetItemAdapter(sortPageInfo(getPageContents())); mWidgetItemAdapter.setOnItemClickListener(this); diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/BaseSimpleListFragment.java b/app/src/main/java/com/xuexiang/xuidemo/base/BaseSimpleListFragment.java index 43687d26..f191dce7 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/BaseSimpleListFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/BaseSimpleListFragment.java @@ -67,7 +67,7 @@ protected TitleBar initTitle() { @MemoryCache private Drawable getNavigationBackDrawable(int navigationBackId) { - return DrawableUtils.getSupportRTLDrawable(ThemeUtils.resolveDrawable(getContext(), navigationBackId)); + return DrawableUtils.getSupportRTLDrawable(getContext(), ThemeUtils.resolveDrawable(getContext(), navigationBackId)); } @Override diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/ComponentContainerFragment.java b/app/src/main/java/com/xuexiang/xuidemo/base/ComponentContainerFragment.java index b0a7813d..ede72c4c 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/ComponentContainerFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/ComponentContainerFragment.java @@ -55,7 +55,7 @@ protected TitleBar initTitle() { @MemoryCache private Drawable getNavigationBackDrawable(int navigationBackId) { - return DrawableUtils.getSupportRTLDrawable(ThemeUtils.resolveDrawable(getContext(), navigationBackId)); + return DrawableUtils.getSupportRTLDrawable(getContext(), ThemeUtils.resolveDrawable(getContext(), navigationBackId)); } @Override diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/XPageTransferActivity.java b/app/src/main/java/com/xuexiang/xuidemo/base/XPageTransferActivity.java index 6aab72d9..4f397376 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/XPageTransferActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/XPageTransferActivity.java @@ -23,7 +23,7 @@ import com.xuexiang.xrouter.annotation.Router; import com.xuexiang.xrouter.launcher.XRouter; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.StringUtils; /** diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/webview/AgentWebActivity.java b/app/src/main/java/com/xuexiang/xuidemo/base/webview/AgentWebActivity.java index fc51c54c..d7fd08ce 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/webview/AgentWebActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/webview/AgentWebActivity.java @@ -30,7 +30,7 @@ import com.xuexiang.xui.widget.slideback.SlideBack; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseAppCompatActivity; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import static com.xuexiang.xuidemo.base.webview.AgentWebFragment.KEY_URL; diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/webview/AgentWebFragment.java b/app/src/main/java/com/xuexiang/xuidemo/base/webview/AgentWebFragment.java index 1bcc6bd5..eb137a58 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/webview/AgentWebFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/webview/AgentWebFragment.java @@ -70,7 +70,7 @@ import com.xuexiang.xui.utils.DrawableUtils; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.net.JsonUtil; import java.util.HashMap; diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/webview/MiddlewareWebViewClient.java b/app/src/main/java/com/xuexiang/xuidemo/base/webview/MiddlewareWebViewClient.java index 4a254bd9..85f48d9e 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/webview/MiddlewareWebViewClient.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/webview/MiddlewareWebViewClient.java @@ -16,6 +16,7 @@ package com.xuexiang.xuidemo.base.webview; +import android.content.Context; import android.net.Uri; import android.os.Build; import android.util.Log; @@ -87,7 +88,7 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) { @Override public WebResourceResponse shouldInterceptRequest(WebView view, String url) { url = url.toLowerCase(); - if (!hasAd(url)) { + if (!hasAd(view.getContext(), url)) { //正常加载 return super.shouldInterceptRequest(view, url); } else { @@ -100,7 +101,7 @@ public WebResourceResponse shouldInterceptRequest(WebView view, String url) { @Override public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { String url = request.getUrl().toString().toLowerCase(); - if (!hasAd(url)) { + if (!hasAd(view.getContext(), url)) { //正常加载 return super.shouldInterceptRequest(view, request); } else { @@ -115,8 +116,8 @@ public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceReque * @param url * @return */ - public static boolean hasAd(String url) { - String[] adUrls = ResUtils.getStringArray(R.array.adBlockUrl); + public static boolean hasAd(Context context, String url) { + String[] adUrls = ResUtils.getStringArray(context, R.array.adBlockUrl); for (String adUrl : adUrls) { if (url.contains(adUrl)) { return true; diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/webview/WebViewInterceptDialog.java b/app/src/main/java/com/xuexiang/xuidemo/base/webview/WebViewInterceptDialog.java index 720d230c..d94d9d8b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/webview/WebViewInterceptDialog.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/webview/WebViewInterceptDialog.java @@ -29,7 +29,7 @@ import com.xuexiang.xui.utils.ResUtils; import com.xuexiang.xui.widget.dialog.DialogLoader; import com.xuexiang.xuidemo.R; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.XUtil; import com.xuexiang.xutil.app.ActivityUtils; @@ -64,7 +64,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { DialogLoader.getInstance().showConfirmDialog( this, getOpenTitle(url), - ResUtils.getString(R.string.lab_yes), + ResUtils.getString(this, R.string.lab_yes), (dialog, which) -> { dialog.dismiss(); if (isAppLink(url)) { @@ -73,7 +73,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { openApp(url); } }, - ResUtils.getString(R.string.lab_no), + ResUtils.getString(this, R.string.lab_no), (dialog, which) -> dialog.dismiss() ).setOnDismissListener(this); @@ -84,7 +84,7 @@ private String getOpenTitle(String url) { if ("mqqopensdkapi".equals(scheme)) { return "是否允许页面打开\"QQ\"?"; } else { - return ResUtils.getString(R.string.lab_open_third_app); + return ResUtils.getString(this, R.string.lab_open_third_app); } } diff --git a/app/src/main/java/com/xuexiang/xuidemo/base/webview/XPageWebViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/base/webview/XPageWebViewFragment.java index ec6b1bc9..483bcca7 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/base/webview/XPageWebViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/base/webview/XPageWebViewFragment.java @@ -72,7 +72,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.logger.Logger; import com.xuexiang.xutil.net.JsonUtil; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/MarqueeViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/MarqueeViewFragment.java index 1c31bc72..eed6f534 100755 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/MarqueeViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/MarqueeViewFragment.java @@ -14,7 +14,7 @@ import com.xuexiang.xui.widget.textview.marqueen.SimpleNoticeMF; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.ArrayList; import java.util.Arrays; @@ -100,7 +100,7 @@ public DisplayEntity onStartMarquee(DisplayEntity displayMsg, int index) { if ("离离原上草,一岁一枯荣。".equals(displayMsg.toString())) { return null; } else { - XToastUtils.toast("开始滚动:" + displayMsg.toString()); + XToastUtils.toast("开始滚动:" + displayMsg); return displayMsg; } } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/TextViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/TextViewFragment.java index 23d74662..768b563b 100755 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/TextViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/TextViewFragment.java @@ -9,6 +9,7 @@ import com.xuexiang.xuidemo.fragment.components.textview.ExpandableTextViewFragment; import com.xuexiang.xuidemo.fragment.components.textview.LabelViewFragment; import com.xuexiang.xuidemo.fragment.components.textview.LoggerTextViewFragment; +import com.xuexiang.xuidemo.fragment.components.textview.ReadMoreTextViewFragment; import com.xuexiang.xuidemo.fragment.components.textview.SuperTextViewFragment; /** @@ -29,7 +30,8 @@ public Class[] getPagesClasses() { BadgeViewFragment.class, AutoFitTextViewFragment.class, AutoHyphenationTextViewFragment.class, - LoggerTextViewFragment.class + LoggerTextViewFragment.class, + ReadMoreTextViewFragment.class }; } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/TitleBarFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/TitleBarFragment.java index d205bd98..a6c8b689 100755 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/TitleBarFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/TitleBarFragment.java @@ -23,7 +23,7 @@ import com.xuexiang.xui.widget.actionbar.TitleBar; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/banner/RecyclerViewBannerFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/banner/RecyclerViewBannerFragment.java index be48eb37..706ed24b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/banner/RecyclerViewBannerFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/banner/RecyclerViewBannerFragment.java @@ -23,7 +23,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.adapter.RecyclerViewBannerAdapter; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/banner/ViewPagerBannerFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/banner/ViewPagerBannerFragment.java index 3998c290..1fe1c4c4 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/banner/ViewPagerBannerFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/banner/ViewPagerBannerFragment.java @@ -33,7 +33,7 @@ import com.xuexiang.xuidemo.DemoDataProvider; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xuidemo.widget.RadiusImageBanner; import java.util.ArrayList; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/ButtonStyleFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/ButtonStyleFragment.java index 4b91626f..7ada9205 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/ButtonStyleFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/ButtonStyleFragment.java @@ -8,7 +8,7 @@ import com.xuexiang.xui.widget.textview.supertextview.SuperButton; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/ShineButtonFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/ShineButtonFragment.java index 98a3fc50..46dd148b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/ShineButtonFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/ShineButtonFragment.java @@ -24,7 +24,7 @@ import com.xuexiang.xui.widget.button.shinebutton.ShineButton; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xuidemo.widget.ShineButtonDialog; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/SmoothCheckBoxFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/SmoothCheckBoxFragment.java index 6ff2d171..37f2993a 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/SmoothCheckBoxFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/SmoothCheckBoxFragment.java @@ -21,7 +21,7 @@ import com.xuexiang.xui.widget.button.SmoothCheckBox; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/SwitchButtonFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/SwitchButtonFragment.java index 43bf5cfe..c115be56 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/SwitchButtonFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/button/SwitchButtonFragment.java @@ -7,7 +7,7 @@ import com.xuexiang.xui.widget.button.switchbutton.SwitchButton; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/BottomSheetFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/BottomSheetFragment.java index 3e1c078b..de9c2c2c 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/BottomSheetFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/BottomSheetFragment.java @@ -4,7 +4,7 @@ import com.xuexiang.xui.widget.dialog.bottomsheet.BottomSheet; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseSimpleListFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/DialogStrategyFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/DialogStrategyFragment.java index 36fec721..1028181f 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/DialogStrategyFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/DialogStrategyFragment.java @@ -28,7 +28,7 @@ import com.xuexiang.xui.widget.dialog.strategy.impl.MaterialDialogStrategy; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseSimpleListFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/MaterialDialogFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/MaterialDialogFragment.java index 399678e9..2d84371a 100755 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/MaterialDialogFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/dialog/MaterialDialogFragment.java @@ -26,7 +26,7 @@ import com.xuexiang.xui.widget.dialog.materialdialog.simplelist.MaterialSimpleListItem; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseSimpleListFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/edittext/VerifyCodeEditTextFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/edittext/VerifyCodeEditTextFragment.java index ead0d5a1..ae29dc34 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/edittext/VerifyCodeEditTextFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/edittext/VerifyCodeEditTextFragment.java @@ -4,7 +4,7 @@ import com.xuexiang.xui.widget.edittext.verify.VerifyCodeEditText; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/flowlayout/FlexboxLayoutFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/flowlayout/FlexboxLayoutFragment.java index ea87f0b7..2a5ef034 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/flowlayout/FlexboxLayoutFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/flowlayout/FlexboxLayoutFragment.java @@ -29,7 +29,7 @@ import com.xuexiang.xuidemo.adapter.FlexboxLayoutAdapter; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.StringUtils; import butterknife.BindView; @@ -76,7 +76,7 @@ public void performAction(View view) { @Override protected void initViews() { - String[] array = ResUtils.getStringArray(R.array.tags_values); + String[] array = ResUtils.getStringArray(getContext(), R.array.tags_values); recyclerView1.setLayoutManager(Utils.getFlexboxLayoutManager(getContext())); recyclerView1.setAdapter(mAdapter1 = new FlexboxLayoutAdapter(array)); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/flowlayout/FlowTagLayoutFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/flowlayout/FlowTagLayoutFragment.java index e4238a28..f3f41496 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/flowlayout/FlowTagLayoutFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/flowlayout/FlowTagLayoutFragment.java @@ -9,7 +9,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.adapter.FlowTagAdapter; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.List; @@ -72,7 +72,7 @@ private void initNormalFlowTagLayout() { FlowTagAdapter tagAdapter = new FlowTagAdapter(getContext()); mNormalFlowTagLayout.setAdapter(tagAdapter); mNormalFlowTagLayout.setOnTagClickListener((parent, view, position) -> XToastUtils.toast("点击了:" + parent.getAdapter().getItem(position))); - tagAdapter.addTags(ResUtils.getStringArray(R.array.tags_values)); + tagAdapter.addTags(ResUtils.getStringArray(getContext(), R.array.tags_values)); } private void initSingleFlowTagLayout() { @@ -80,7 +80,7 @@ private void initSingleFlowTagLayout() { mSingleFlowTagLayout.setAdapter(tagAdapter); mSingleFlowTagLayout.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_SINGLE); mSingleFlowTagLayout.setOnTagSelectListener((parent, position, selectedList) -> XToastUtils.toast(getSelectedText(parent, selectedList))); - tagAdapter.addTags(ResUtils.getStringArray(R.array.tags_values)); + tagAdapter.addTags(ResUtils.getStringArray(getContext(), R.array.tags_values)); tagAdapter.setSelectedPositions(2, 3, 4); } @@ -90,7 +90,7 @@ private void initSingleCancelableFlowTagLayout() { mSingleCancelableFlowTagLayout.setAdapter(tagAdapter); mSingleCancelableFlowTagLayout.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_SINGLE); mSingleCancelableFlowTagLayout.setOnTagSelectListener((parent, position, selectedList) -> XToastUtils.toast(getSelectedText(parent, selectedList))); - tagAdapter.addTags(ResUtils.getStringArray(R.array.tags_values)); + tagAdapter.addTags(ResUtils.getStringArray(getContext(), R.array.tags_values)); tagAdapter.setSelectedPositions(2, 3, 4); } @@ -100,7 +100,7 @@ private void initMultiFlowTagLayout() { mMultiFlowTagLayout.setAdapter(tagAdapter); mMultiFlowTagLayout.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_MULTI); mMultiFlowTagLayout.setOnTagSelectListener((parent, position, selectedList) -> XToastUtils.toast(getSelectedText(parent, selectedList))); - tagAdapter.addTags(ResUtils.getStringArray(R.array.tags_values)); + tagAdapter.addTags(ResUtils.getStringArray(getContext(), R.array.tags_values)); tagAdapter.setSelectedPositions(2, 3, 4); // mMultiFlowTagLayout.setItems("1111", "2222", "3333", "4444"); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/ImageLoadStrategyFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/ImageLoadStrategyFragment.java index 6a4d1cf1..05fa2426 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/ImageLoadStrategyFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/ImageLoadStrategyFragment.java @@ -76,11 +76,11 @@ public void onLoadFailed(Throwable error) { } }); LoadOption option = LoadOption.of(DiskCacheStrategyEnum.ALL) - .setPlaceholder(ResUtils.getDrawable(R.drawable.xui_ic_default_img)) - .setSize(DensityUtils.dp2px(200), DensityUtils.dp2px(100)); + .setPlaceholder(ResUtils.getDrawable(getContext(), R.drawable.xui_ic_default_img)) + .setSize(DensityUtils.dp2px(getContext(), 200), DensityUtils.dp2px(getContext(), 100)); ImageLoader.get().loadImage(ivContent1, PICTURE_URL1, option); - ImageLoader.get().loadImage(ivContent2, PICTURE_URL2, ResUtils.getDrawable(R.drawable.xui_ic_default_img), DiskCacheStrategyEnum.AUTOMATIC); + ImageLoader.get().loadImage(ivContent2, PICTURE_URL2, ResUtils.getDrawable(getContext(), R.drawable.xui_ic_default_img), DiskCacheStrategyEnum.AUTOMATIC); } } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/SignatureViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/SignatureViewFragment.java index 9b566e84..b0c86405 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/SignatureViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/SignatureViewFragment.java @@ -25,7 +25,7 @@ import com.xuexiang.xui.widget.imageview.SignatureView; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/edit/ImageEnhanceFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/edit/ImageEnhanceFragment.java index 77f64e30..5efcd3a1 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/edit/ImageEnhanceFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/edit/ImageEnhanceFragment.java @@ -32,7 +32,7 @@ import com.xuexiang.xui.widget.imageview.edit.PhotoEnhance; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.app.IntentUtils; import com.xuexiang.xutil.app.PathUtils; import com.xuexiang.xutil.display.ImageUtils; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/edit/PhotoEditFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/edit/PhotoEditFragment.java index 94b6e91d..2b2ecfce 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/edit/PhotoEditFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/edit/PhotoEditFragment.java @@ -39,7 +39,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.app.IntentUtils; import com.xuexiang.xutil.app.PathUtils; import com.xuexiang.xutil.display.ImageUtils; @@ -99,13 +99,13 @@ public void onViewClicked(View view) { mPhotoEditor.redo(); break; case R.id.btn_brush: - mPhotoEditor.setBrushColor(ResUtils.getColor(R.color.xui_config_color_white)) - .setBrushSize(DensityUtils.dp2px(5)) + mPhotoEditor.setBrushColor(ResUtils.getColor(getContext(), R.color.xui_config_color_white)) + .setBrushSize(DensityUtils.dp2px(getContext(), 5)) .setBrushDrawingMode(true); break; case R.id.btn_text: final TextStyleBuilder styleBuilder = new TextStyleBuilder(); - styleBuilder.withTextColor(ResUtils.getColor(R.color.xui_config_color_white)); + styleBuilder.withTextColor(ResUtils.getColor(getContext(), R.color.xui_config_color_white)); mPhotoEditor.addText("XUI", styleBuilder); break; case R.id.btn_rubber: diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/preview/NineGridImageViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/preview/NineGridImageViewFragment.java index 18327d27..8ddaab5a 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/preview/NineGridImageViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/preview/NineGridImageViewFragment.java @@ -33,7 +33,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.adapter.NineGridRecycleAdapter; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/preview/PreviewRecycleViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/preview/PreviewRecycleViewFragment.java index e7834fee..07ab2a3b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/preview/PreviewRecycleViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/imageview/preview/PreviewRecycleViewFragment.java @@ -39,7 +39,7 @@ import com.xuexiang.xuidemo.adapter.PreviewRecycleAdapter; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.SettingSPUtils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.List; @@ -99,7 +99,7 @@ protected int getLayoutId() { @Override protected void initViews() { mRecyclerView.setLayoutManager(mGridLayoutManager = new GridLayoutManager(getContext(), 2)); - mRecyclerView.addItemDecoration(new GridDividerItemDecoration(getContext(), 2, DensityUtils.dp2px(3))); + mRecyclerView.addItemDecoration(new GridDividerItemDecoration(getContext(), 2, DensityUtils.dp2px(getContext(), 3))); mRecyclerView.setHasFixedSize(true); mRecyclerView.setAdapter(mAdapter = new PreviewRecycleAdapter()); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/GroupListViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/GroupListViewFragment.java index 016a5de4..0537016f 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/GroupListViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/GroupListViewFragment.java @@ -29,7 +29,7 @@ import com.xuexiang.xui.widget.progress.loading.MiniLoadingView; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/LinkageScrollLayoutFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/LinkageScrollLayoutFragment.java index bdac2832..649e615a 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/LinkageScrollLayoutFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/LinkageScrollLayoutFragment.java @@ -31,7 +31,7 @@ import com.xuexiang.xuidemo.adapter.NewsCardViewListAdapter; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/expandable/ExpandableSimpleFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/expandable/ExpandableSimpleFragment.java index cc9afd9d..902d3cf6 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/expandable/ExpandableSimpleFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/layout/expandable/ExpandableSimpleFragment.java @@ -23,7 +23,7 @@ import com.xuexiang.xui.widget.layout.ExpandableLayout; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/AddressPickerFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/AddressPickerFragment.java index 973915e6..1818117d 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/AddressPickerFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/AddressPickerFragment.java @@ -27,7 +27,7 @@ import com.xuexiang.xuidemo.DemoDataProvider; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/OptionsPickerViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/OptionsPickerViewFragment.java index de935eb9..07422f9c 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/OptionsPickerViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/OptionsPickerViewFragment.java @@ -55,10 +55,10 @@ protected int getLayoutId() { */ @Override protected void initViews() { - mSexOption = ResUtils.getStringArray(R.array.sex_option); - mGradeOption = ResUtils.getStringArray(R.array.grade_option); - mConstellationOption = ResUtils.getStringArray(R.array.constellation_entry); - mNationOption = ResUtils.getStringArray(R.array.nation_value); + mSexOption = ResUtils.getStringArray(getContext(), R.array.sex_option); + mGradeOption = ResUtils.getStringArray(getContext(), R.array.grade_option); + mConstellationOption = ResUtils.getStringArray(getContext(), R.array.constellation_entry); + mNationOption = ResUtils.getStringArray(getContext(), R.array.nation_value); mClassOption = new String[30]; for (int i = 0; i < mClassOption.length; i++) { mClassOption[i] = (i + 1) + "班"; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/RulerViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/RulerViewFragment.java index 4ff1655e..94e5a47a 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/RulerViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/RulerViewFragment.java @@ -8,7 +8,7 @@ import com.xuexiang.xui.widget.picker.RulerView; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.StringUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/TimePickerFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/TimePickerFragment.java index dd85430a..d724f71b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/TimePickerFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/pickerview/TimePickerFragment.java @@ -32,7 +32,7 @@ import com.xuexiang.xuidemo.DemoDataProvider; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.data.DateUtils; import java.util.Calendar; @@ -77,10 +77,10 @@ public void onViewClicked(View view) { showTimePickerDialog(); break; case R.id.btn_date_system: - showDatePickerDialog(getContext(), DatePickerDialog.THEME_DEVICE_DEFAULT_LIGHT, (TextView) view, Calendar.getInstance()); + showDatePickerDialog(getContext(), R.style.XUITheme_AlertDialog, (TextView) view, Calendar.getInstance()); break; case R.id.btn_time_system: - showTimePickerDialog(getContext(), DatePickerDialog.THEME_DEVICE_DEFAULT_LIGHT, (TextView) view, Calendar.getInstance()); + showTimePickerDialog(getContext(), R.style.XUITheme_AlertDialog, (TextView) view, Calendar.getInstance()); break; case R.id.btn_time_period: showTimePeriodPicker(); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/CookieBarFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/CookieBarFragment.java index a46c93b5..1c975ee5 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/CookieBarFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/CookieBarFragment.java @@ -23,7 +23,7 @@ import com.xuexiang.xui.widget.popupwindow.bar.CookieBar; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/EasyPopFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/EasyPopFragment.java index 07158b35..a7912a88 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/EasyPopFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/EasyPopFragment.java @@ -10,7 +10,7 @@ import com.xuexiang.xui.widget.popupwindow.easypopup.VerticalGravity; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/PopupWindowStyleFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/PopupWindowStyleFragment.java index 55206a7f..3ab7f2a3 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/PopupWindowStyleFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/PopupWindowStyleFragment.java @@ -10,7 +10,7 @@ import com.xuexiang.xuidemo.DemoDataProvider; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.display.DensityUtils; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/SnackbarFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/SnackbarFragment.java index 5b08f692..546113e0 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/SnackbarFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/SnackbarFragment.java @@ -27,7 +27,7 @@ import com.xuexiang.xui.utils.SnackbarUtils; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.OnClick; @@ -64,7 +64,7 @@ public void onClickDuring(View view) { break; case R.id.btn_indefinite: SnackbarUtils.Indefinite(view, "显示时长:无限 + info").info() - .actionColor(ResUtils.getColor(R.color.xui_config_color_white)) + .actionColor(ResUtils.getColor(getContext(), R.color.xui_config_color_white)) .setAction("确定", v -> XToastUtils.toast("点击了确定!")).show(); break; case R.id.btn_length_custom: diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/ViewTipFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/ViewTipFragment.java index 27f22002..7099f6a6 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/ViewTipFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/ViewTipFragment.java @@ -8,7 +8,7 @@ import com.xuexiang.xui.widget.popupwindow.ViewTooltip; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/XToastFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/XToastFragment.java index 441ef0e2..44082cca 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/XToastFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/XToastFragment.java @@ -6,7 +6,7 @@ import com.xuexiang.xui.widget.toast.XToast; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseSimpleListFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/XUIPopupFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/XUIPopupFragment.java index 4d92223e..e47d2134 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/XUIPopupFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/popupwindow/XUIPopupFragment.java @@ -14,7 +14,7 @@ import com.xuexiang.xui.widget.popupwindow.popup.XUIPopup; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; @@ -80,8 +80,8 @@ private void initNormalPopupIfNeed() { DensityUtils.dp2px(getContext(), 250), WRAP_CONTENT )); - textView.setLineSpacing(DensityUtils.dp2px(4), 1.0f); - int padding = DensityUtils.dp2px(20); + textView.setLineSpacing(DensityUtils.dp2px(getContext(), 4), 1.0f); + int padding = DensityUtils.dp2px(getContext(), 20); textView.setPadding(padding, padding, padding, padding); textView.setText("Popup 可以设置其位置以及显示和隐藏的动画"); textView.setTextColor(ContextCompat.getColor(getContext(), R.color.xui_config_color_content_text)); @@ -108,7 +108,7 @@ private void initListPopupIfNeed() { XUISimpleAdapter adapter = XUISimpleAdapter.create(getContext(), listItems); mListPopup = new XUIListPopup(getContext(), adapter); - mListPopup.create(DensityUtils.dp2px(200), DensityUtils.dp2px(150), (adapterView, view, i, l) -> { + mListPopup.create(DensityUtils.dp2px(getContext(), 200), DensityUtils.dp2px(getContext(), 150), (adapterView, view, i, l) -> { XToastUtils.toast("Item " + (i + 1)); mListPopup.dismiss(); }); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/progress/RatingBarFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/progress/RatingBarFragment.java index 86d3555d..aded45d8 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/progress/RatingBarFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/progress/RatingBarFragment.java @@ -9,7 +9,7 @@ import com.xuexiang.xui.widget.progress.ratingbar.ScaleRatingBar; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/broccoli/AnimationPlaceholderFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/broccoli/AnimationPlaceholderFragment.java index d129a22b..f84d3da8 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/broccoli/AnimationPlaceholderFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/broccoli/AnimationPlaceholderFragment.java @@ -46,7 +46,7 @@ protected int getLayoutId() { */ @Override protected void initViews() { - WidgetUtils.initRecyclerView(recyclerView, DensityUtils.dp2px(5), ThemeUtils.resolveColor(getContext(), R.attr.xui_config_color_background)); + WidgetUtils.initRecyclerView(recyclerView, DensityUtils.dp2px(getContext(), 5), ThemeUtils.resolveColor(getContext(), R.attr.xui_config_color_background)); recyclerView.setAdapter(mNewsListAdapter = new NewsListAdapter(true)); } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/broccoli/CommonPlaceholderFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/broccoli/CommonPlaceholderFragment.java index 0640c8d8..4efaa0a1 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/broccoli/CommonPlaceholderFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/broccoli/CommonPlaceholderFragment.java @@ -62,7 +62,7 @@ public void performAction(View view) { */ @Override protected void initViews() { - WidgetUtils.initRecyclerView(recyclerView, DensityUtils.dp2px(5), ThemeUtils.resolveColor(getContext(), R.attr.xui_config_color_background)); + WidgetUtils.initRecyclerView(recyclerView, DensityUtils.dp2px(getContext(), 5), ThemeUtils.resolveColor(getContext(), R.attr.xui_config_color_background)); recyclerView.setAdapter(mNewsListAdapter = new NewsListAdapter(false)); } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sample/edit/NewsListEditFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sample/edit/NewsListEditFragment.java index e658bc63..82909726 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sample/edit/NewsListEditFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sample/edit/NewsListEditFragment.java @@ -34,7 +34,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sample/selection/ListSelectionFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sample/selection/ListSelectionFragment.java index cef726f9..aa5d56fb 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sample/selection/ListSelectionFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sample/selection/ListSelectionFragment.java @@ -27,7 +27,7 @@ import com.xuexiang.xui.widget.actionbar.TitleBar; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/smartrefresh/RefreshBasicFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/smartrefresh/RefreshBasicFragment.java index e3c61ca7..b343047f 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/smartrefresh/RefreshBasicFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/smartrefresh/RefreshBasicFragment.java @@ -25,7 +25,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.adapter.SimpleRecyclerAdapter; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; /** * @author xuexiang * @since 2018/12/6 下午5:57 diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/smartrefresh/RefreshStatusLayoutFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/smartrefresh/RefreshStatusLayoutFragment.java index ebff4249..157ca2af 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/smartrefresh/RefreshStatusLayoutFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/smartrefresh/RefreshStatusLayoutFragment.java @@ -27,7 +27,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.adapter.SimpleRecyclerAdapter; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sticky/StickyCustomFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sticky/StickyCustomFragment.java index 47d38897..93a845a4 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sticky/StickyCustomFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sticky/StickyCustomFragment.java @@ -36,7 +36,7 @@ import com.xuexiang.xuidemo.adapter.entity.StickyItem; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sticky/StickyItemDecorationFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sticky/StickyItemDecorationFragment.java index a6529d12..32caecb9 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sticky/StickyItemDecorationFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/sticky/StickyItemDecorationFragment.java @@ -34,7 +34,7 @@ import com.xuexiang.xuidemo.adapter.entity.StickyItem; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeDragMoveFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeDragMoveFragment.java index ae1a90a3..acb38104 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeDragMoveFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeDragMoveFragment.java @@ -12,7 +12,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.adapter.swipe.SwipeDragTouchListAdapter; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.yanzhenjie.recyclerview.SwipeRecyclerView; import com.yanzhenjie.recyclerview.touch.OnItemMoveListener; import com.yanzhenjie.recyclerview.touch.OnItemStateChangedListener; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeHeadFootViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeHeadFootViewFragment.java index 1d83946d..5099ba2d 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeHeadFootViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeHeadFootViewFragment.java @@ -9,7 +9,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.adapter.SimpleRecyclerAdapter; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.yanzhenjie.recyclerview.SwipeRecyclerView; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeMenuItemFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeMenuItemFragment.java index 8728e44f..498d61e1 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeMenuItemFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeMenuItemFragment.java @@ -12,7 +12,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.adapter.SimpleRecyclerAdapter; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.yanzhenjie.recyclerview.OnItemMenuClickListener; import com.yanzhenjie.recyclerview.SwipeMenuCreator; import com.yanzhenjie.recyclerview.SwipeMenuItem; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeRefreshFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeRefreshFragment.java index ddca6371..9cac381b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeRefreshFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/refresh/swipe/SwipeRefreshFragment.java @@ -12,7 +12,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.adapter.SimpleRecyclerAdapter; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xuidemo.widget.MaterialLoadMoreView; import com.yanzhenjie.recyclerview.SwipeRecyclerView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/spinner/DropDownMenuFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/spinner/DropDownMenuFragment.java index 1bb98d2c..c7ccda55 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/spinner/DropDownMenuFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/spinner/DropDownMenuFragment.java @@ -83,10 +83,10 @@ public void onClick(View v) { @Override protected void initArgs() { - mCitys = ResUtils.getStringArray(R.array.city_entry); - mAges = ResUtils.getStringArray(R.array.age_entry); - mSexs = ResUtils.getStringArray(R.array.sex_entry); - mConstellations = ResUtils.getStringArray(R.array.constellation_entry); + mCitys = ResUtils.getStringArray(getContext(), R.array.city_entry); + mAges = ResUtils.getStringArray(getContext(), R.array.age_entry); + mSexs = ResUtils.getStringArray(getContext(), R.array.sex_entry); + mConstellations = ResUtils.getStringArray(getContext(), R.array.constellation_entry); } @Override diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/spinner/SpinnerStyleFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/spinner/SpinnerStyleFragment.java index 7cb55c31..239a5a7c 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/spinner/SpinnerStyleFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/spinner/SpinnerStyleFragment.java @@ -20,7 +20,7 @@ import com.xuexiang.xui.widget.textview.supertextview.SuperButton; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xuidemo.widget.EditSpinnerDialog; import java.util.ArrayList; @@ -73,9 +73,9 @@ protected void initViews() { KeyboardUtils.setSoftInputAdjustResize(getActivity()); //修改输入法模式 WidgetUtils.setSpinnerDropDownVerticalOffset(mSpinnerFitOffset); - WidgetUtils.initSpinnerStyle(mSpinnerSystem, ResUtils.getStringArray(R.array.sort_mode_entry)); + WidgetUtils.initSpinnerStyle(mSpinnerSystem, ResUtils.getStringArray(getContext(), R.array.sort_mode_entry)); - mMaterialSpinner.setItems(ResUtils.getStringArray(R.array.sort_mode_entry)); + mMaterialSpinner.setItems(ResUtils.getStringArray(getContext(), R.array.sort_mode_entry)); mMaterialSpinner.setOnItemSelectedListener((spinner, position, id, item) -> SnackbarUtils.Long(spinner, "Clicked " + item).show()); mMaterialSpinner.setOnNothingSelectedListener(spinner -> SnackbarUtils.Long(spinner, "Nothing selected").show()); // mMaterialSpinner.setSelectedIndex(1); @@ -90,7 +90,7 @@ protected void initViews() { //注意自定义实体,需要重写对象的toString方法 mEditSpinner1.setAdapter(new EditSpinnerAdapter<>(list) - .setTextColor(ResUtils.getColor(R.color.color_green)) + .setTextColor(ResUtils.getColor(getContext(), R.color.color_green)) .setTextSize(mEditSpinner1.getEditText().getTextSize()) .setIsFilterKey(true) .setFilterColor("#FFFF00") @@ -107,7 +107,7 @@ public void onConfigurationChanged(@NonNull Configuration newConfig) { @MemoryCache public List getAdapterItems() { List list = new ArrayList<>(); - String[] array = ResUtils.getStringArray(R.array.sort_mode_entry); + String[] array = ResUtils.getStringArray(getContext(), R.array.sort_mode_entry); for (String s : array) { list.add(new AdapterItem(s)); } @@ -128,7 +128,7 @@ protected void initListeners() { @OnClick(R.id.btn_dialog) void onClick(View v) { - showEditSpinnerDialog(getContext(), "排序顺序", data, ResUtils.getStringArray(R.array.sort_mode_entry), value -> data = value); + showEditSpinnerDialog(getContext(), "排序顺序", data, ResUtils.getStringArray(getContext(), R.array.sort_mode_entry), value -> data = value); } /** diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/MultipleStatusViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/MultipleStatusViewFragment.java index 9dedc045..870b694b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/MultipleStatusViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/MultipleStatusViewFragment.java @@ -9,7 +9,7 @@ import com.xuexiang.xui.widget.statelayout.MultipleStatusView; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/StatefulLayoutFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/StatefulLayoutFragment.java index b172ca7a..3ca1ac07 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/StatefulLayoutFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/StatefulLayoutFragment.java @@ -7,7 +7,7 @@ import com.xuexiang.xui.widget.statelayout.StatefulLayout; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/StatusViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/StatusViewFragment.java index eedd983b..eae5997d 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/StatusViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/StatusViewFragment.java @@ -23,7 +23,7 @@ import com.xuexiang.xui.widget.popupwindow.status.StatusView; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/status/BaseStatusLoaderFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/status/BaseStatusLoaderFragment.java index aef62474..acad6246 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/status/BaseStatusLoaderFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/statelayout/status/BaseStatusLoaderFragment.java @@ -23,7 +23,7 @@ import com.xuexiang.xui.widget.statelayout.StatusLoader; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import static com.xuexiang.xui.widget.statelayout.StatusLoader.STATUS_LOADING; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/EasyIndicatorFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/EasyIndicatorFragment.java index a7939d9a..a44c3b9a 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/EasyIndicatorFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/EasyIndicatorFragment.java @@ -33,7 +33,7 @@ import com.xuexiang.xuidemo.activity.EasyIndicatorActivity; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.fragment.components.tabbar.tablayout.ContentPage; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.HashMap; import java.util.Map; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/JPTabBarFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/JPTabBarFragment.java index 7c0c5036..a8b6cf96 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/JPTabBarFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/JPTabBarFragment.java @@ -15,7 +15,7 @@ import com.xuexiang.xui.XUI; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.HashMap; import java.util.Map; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/TabControlViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/TabControlViewFragment.java index 84c1136d..869d5d40 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/TabControlViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/TabControlViewFragment.java @@ -22,7 +22,7 @@ import com.xuexiang.xui.widget.tabbar.TabControlView; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; @@ -52,7 +52,7 @@ protected void initViews() { private void initTabControlView() { try { - mTabControlView.setItems(ResUtils.getStringArray(R.array.course_param_option), ResUtils.getStringArray(R.array.course_param_value)); + mTabControlView.setItems(ResUtils.getStringArray(getContext(), R.array.course_param_option), ResUtils.getStringArray(getContext(), R.array.course_param_value)); mTabControlView.setDefaultSelection(1); } catch (Exception e) { e.printStackTrace(); @@ -62,7 +62,7 @@ private void initTabControlView() { private void initMultiTabControlView() { try { - mMultiTabControlView.setItems(ResUtils.getStringArray(R.array.course_param_option), ResUtils.getStringArray(R.array.course_param_value)); + mMultiTabControlView.setItems(ResUtils.getStringArray(getContext(), R.array.course_param_option), ResUtils.getStringArray(getContext(), R.array.course_param_value)); mMultiTabControlView.setDefaultSelection(1, 2); } catch (Exception e) { e.printStackTrace(); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/TestPageFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/TestPageFragment.java index 2f3ac9eb..48672f24 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/TestPageFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/TestPageFragment.java @@ -53,7 +53,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c TextView textView = new TextView(getContext()); textView.setTextAppearance(getContext(), R.style.TextStyle_Content_Match); textView.setGravity(Gravity.CENTER); - textView.setText("这个是" + content + "页面的内容"); + textView.setText(String.format("这个是%s页面的内容", content)); return textView; } } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/VerticalTabLayoutFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/VerticalTabLayoutFragment.java index 2c5bab2c..6c93b18f 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/VerticalTabLayoutFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/VerticalTabLayoutFragment.java @@ -16,6 +16,7 @@ package com.xuexiang.xuidemo.fragment.components.tabbar; +import android.content.Context; import android.graphics.Color; import android.view.Gravity; import android.view.View; @@ -34,7 +35,7 @@ import com.xuexiang.xui.widget.textview.badge.Badge; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.XUtil; import java.util.ArrayList; @@ -148,13 +149,13 @@ public TabView.TabBadge getBadge(int position) { } @Override - public TabView.TabIcon getIcon(int position) { + public TabView.TabIcon getIcon(@NonNull Context context, int position) { MenuBean menu = menus.get(position); return new TabView.TabIcon.Builder() .setIcon(menu.mSelectIcon, menu.mNormalIcon) .setIconGravity(Gravity.START) - .setIconMargin(DensityUtils.dp2px(5)) - .setIconSize(DensityUtils.dp2px(20), DensityUtils.dp2px(20)) + .setIconMargin(DensityUtils.dp2px(context, 5)) + .setIconSize(DensityUtils.dp2px(context, 20), DensityUtils.dp2px(context, 20)) .build(); } @@ -200,7 +201,7 @@ public TabView.TabBadge getBadge(int position) { } @Override - public TabView.TabIcon getIcon(int position) { + public TabView.TabIcon getIcon(@NonNull Context context, int position) { return null; } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/FragmentCacheAdapter.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/FragmentCacheAdapter.java index e7dcabd7..67f5db6c 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/FragmentCacheAdapter.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/FragmentCacheAdapter.java @@ -53,6 +53,18 @@ public FragmentCacheAdapter addFragment(Fragment fragment, String title) { return this; } + public int replaceFragment(Fragment oldFragment, Fragment newFragment, String newTitle) { + if (oldFragment != null && newFragment != null) { + int index = mFragmentList.indexOf(oldFragment); + if (index != -1) { + mFragmentList.set(index, newFragment); + mTitleList.set(index, newTitle); + } + return index; + } + return -1; + } + @NonNull @Override public Fragment getItem(int position) { diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/FragmentStateViewPager2Adapter.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/FragmentStateViewPager2Adapter.java index ec22bb34..6430cf27 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/FragmentStateViewPager2Adapter.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/FragmentStateViewPager2Adapter.java @@ -67,6 +67,28 @@ public FragmentStateViewPager2Adapter addFragment(int index, Fragment fragment, return this; } + public FragmentStateViewPager2Adapter replaceFragment(int index, Fragment newFragment, String newTitle) { + if (newFragment != null) { + mFragmentList.set(index, newFragment); + mTitleList.set(index, newTitle); + mIds.set(index, getAtomicGeneratedId()); + } + return this; + } + + public int replaceFragment(Fragment oldFragment, Fragment newFragment, String newTitle) { + if (oldFragment != null && newFragment != null) { + int index = mFragmentList.indexOf(oldFragment); + if (index != -1) { + mFragmentList.set(index, newFragment); + mTitleList.set(index, newTitle); + mIds.set(index, getAtomicGeneratedId()); + } + return index; + } + return -1; + } + public FragmentStateViewPager2Adapter removeFragment(int index) { if (index >= 0 && index < mFragmentList.size()) { mFragmentList.remove(index); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/SimpleTabFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/SimpleTabFragment.java index b5a0c6d2..8d2c4b15 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/SimpleTabFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/SimpleTabFragment.java @@ -23,6 +23,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; import android.widget.TextView; import androidx.annotation.NonNull; @@ -51,21 +52,31 @@ public class SimpleTabFragment extends Fragment { TextView tvTitle; @BindView(R.id.tv_explain) TextView tvExplain; + @BindView(R.id.btn_refresh) + Button btnRefresh; private Unbinder mUnbinder; @AutoWired(name = KEY_TITLE) String title; + private OnRefreshListener mListener; - public static SimpleTabFragment newInstance(String title) { + + public static SimpleTabFragment newInstance(String title, OnRefreshListener listener) { Bundle args = new Bundle(); args.putString(KEY_TITLE, title); SimpleTabFragment fragment = new SimpleTabFragment(); fragment.setArguments(args); + fragment.setOnRefreshListener(listener); return fragment; } + public SimpleTabFragment setOnRefreshListener(OnRefreshListener listener) { + mListener = listener; + return this; + } + @Override public void onAttach(@NonNull Context context) { super.onAttach(context); @@ -110,6 +121,11 @@ private void initView() { Log.e(TAG, "initView, random number:" + randomNumber + ", " + title); tvTitle.setText(String.format("这个是%s页面的内容", title)); tvExplain.setText(String.format("这个是页面随机生成的数字:%d", randomNumber)); + btnRefresh.setOnClickListener(v -> { + if (mListener != null) { + mListener.onTabRefresh(this, title); + } + }); } @Override @@ -121,4 +137,14 @@ public void onDestroyView() { Log.e(TAG, "onDestroyView:" + title); } + + public interface OnRefreshListener { + /** + * 刷新 + * + * @param fragment 页面 + * @param title 标题 + */ + void onTabRefresh(Fragment fragment, String title); + } } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutCacheFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutCacheFragment.java index cce59cb9..f91807d1 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutCacheFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutCacheFragment.java @@ -25,6 +25,7 @@ import android.widget.TextView; import androidx.appcompat.widget.AppCompatImageView; +import androidx.fragment.app.Fragment; import androidx.viewpager.widget.ViewPager; import com.google.android.material.tabs.TabLayout; @@ -35,7 +36,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.fragment.components.tabbar.tabsegment.MultiPage; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; @@ -47,7 +48,7 @@ * @since 2020/4/21 1:11 AM */ @Page(name = "TabLayout+FragmentAdapter的缓存问题") -public class TabLayoutCacheFragment extends BaseFragment implements TabLayout.OnTabSelectedListener { +public class TabLayoutCacheFragment extends BaseFragment implements TabLayout.OnTabSelectedListener, SimpleTabFragment.OnRefreshListener { @BindView(R.id.tab_layout) TabLayout tabLayout; @@ -128,7 +129,7 @@ private void refreshAdapter(boolean isShow) { if (isShow) { // 动态加载选项卡内容 for (String page : MultiPage.getPageNames()) { - mAdapter.addFragment(SimpleTabFragment.newInstance(page), page); + mAdapter.addFragment(SimpleTabFragment.newInstance(page, this), page); } mAdapter.notifyDataSetChanged(); viewPager.setCurrentItem(0, false); @@ -144,6 +145,12 @@ private void switchContainer(boolean isShow) { ViewUtils.setVisibility(viewPager, isShow ? View.VISIBLE : View.GONE); } + @Override + public void onTabRefresh(Fragment fragment, String title) { + String newTitle = title + "R"; + mAdapter.replaceFragment(fragment, SimpleTabFragment.newInstance(newTitle, this), newTitle); + mAdapter.notifyDataSetChanged(); + } @Override public void onTabSelected(TabLayout.Tab tab) { @@ -159,4 +166,12 @@ public void onTabUnselected(TabLayout.Tab tab) { public void onTabReselected(TabLayout.Tab tab) { } + + @Override + public void onDestroyView() { + mAdapter.clear(); + super.onDestroyView(); + } + + } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutSimpleFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutSimpleFragment.java index b27eeac9..3387e5e8 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutSimpleFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutSimpleFragment.java @@ -17,6 +17,7 @@ package com.xuexiang.xuidemo.fragment.components.tabbar.tablayout; +import androidx.fragment.app.Fragment; import androidx.viewpager.widget.ViewPager; import com.google.android.material.tabs.TabLayout; @@ -26,7 +27,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.fragment.components.tabbar.tabsegment.MultiPage; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; @@ -37,7 +38,7 @@ * @since 2020/4/21 12:19 AM */ @Page(name = "TabLayout简单使用") -public class TabLayoutSimpleFragment extends BaseFragment implements TabLayout.OnTabSelectedListener { +public class TabLayoutSimpleFragment extends BaseFragment implements TabLayout.OnTabSelectedListener , SimpleTabFragment.OnRefreshListener { @BindView(R.id.tab1) TabLayout mTabLayout1; @@ -63,7 +64,7 @@ protected void initViews() { // 固定数量的Tab,关联ViewPager FragmentAdapter adapter = new FragmentAdapter<>(getChildFragmentManager()); for (String page : ContentPage.getPageNames()) { - adapter.addFragment(SimpleTabFragment.newInstance(page), page); + adapter.addFragment(SimpleTabFragment.newInstance(page, this), page); } mTabLayout.addOnTabSelectedListener(this); mViewPager.setAdapter(adapter); @@ -74,6 +75,12 @@ protected void initViews() { } + @Override + public void onTabRefresh(Fragment fragment, String title) { + XToastUtils.toast("刷新:" + title); + } + + @Override public void onTabSelected(TabLayout.Tab tab) { XToastUtils.toast("选中了:" + tab.getText()); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutViewPager2Fragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutViewPager2Fragment.java index 4c689d50..173c11ab 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutViewPager2Fragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tablayout/TabLayoutViewPager2Fragment.java @@ -25,6 +25,8 @@ import android.widget.TextView; import androidx.appcompat.widget.AppCompatImageView; +import androidx.fragment.app.Fragment; +import androidx.viewpager2.widget.MarginPageTransformer; import androidx.viewpager2.widget.ViewPager2; import com.google.android.material.tabs.TabLayout; @@ -33,11 +35,11 @@ import com.xuexiang.xpage.annotation.Page; import com.xuexiang.xui.utils.ViewUtils; import com.xuexiang.xui.utils.WidgetUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xui.widget.actionbar.TitleBar; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.fragment.components.tabbar.tabsegment.MultiPage; -import com.xuexiang.xuidemo.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; @@ -49,7 +51,7 @@ * @since 2020/5/21 1:19 AM */ @Page(name = "TabLayout+ViewPager2动态加载") -public class TabLayoutViewPager2Fragment extends BaseFragment implements TabLayout.OnTabSelectedListener { +public class TabLayoutViewPager2Fragment extends BaseFragment implements TabLayout.OnTabSelectedListener, SimpleTabFragment.OnRefreshListener { @BindView(R.id.tab_layout) TabLayout tabLayout; @@ -75,7 +77,7 @@ protected TitleBar initTitle() { titleBar.addAction(new TitleBar.TextAction("增加") { @Override public void performAction(View view) { - mAdapter.addFragment(2, SimpleTabFragment.newInstance("动态加入"), "动态加入"); + mAdapter.addFragment(2, SimpleTabFragment.newInstance("动态加入", TabLayoutViewPager2Fragment.this), "动态加入"); mAdapter.notifyDataSetChanged(); } }); @@ -101,6 +103,8 @@ private void initTabLayout() { viewPager.setAdapter(mAdapter); // 设置缓存的数量 viewPager.setOffscreenPageLimit(1); + // 去除刷新动画 + viewPager.setPageTransformer(new MarginPageTransformer(0)); new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> tab.setText(mAdapter.getPageTitle(position))).attach(); } @@ -152,7 +156,7 @@ private void refreshAdapter(boolean isShow) { if (isShow) { // 动态加载选项卡内容 for (String page : MultiPage.getPageNames()) { - mAdapter.addFragment(SimpleTabFragment.newInstance(page), page); + mAdapter.addFragment(SimpleTabFragment.newInstance(page, this), page); } mAdapter.notifyDataSetChanged(); viewPager.setCurrentItem(0, false); @@ -169,6 +173,14 @@ private void switchContainer(boolean isShow) { } + @Override + public void onTabRefresh(Fragment fragment, String title) { + String newTitle = title + "R"; + int index = mAdapter.replaceFragment(fragment, SimpleTabFragment.newInstance(newTitle, this), newTitle); + mAdapter.notifyItemChanged(index); + } + + @Override public void onTabSelected(TabLayout.Tab tab) { XToastUtils.toast("选中了:" + tab.getText()); @@ -184,4 +196,10 @@ public void onTabReselected(TabLayout.Tab tab) { } + @Override + public void onDestroyView() { + mAdapter.clear(); + super.onDestroyView(); + } + } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tabsegment/TabSegmentFixModeFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tabsegment/TabSegmentFixModeFragment.java index b934c6fb..2c938ef2 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tabsegment/TabSegmentFixModeFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tabsegment/TabSegmentFixModeFragment.java @@ -33,7 +33,7 @@ import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.fragment.components.tabbar.tablayout.ContentPage; import com.xuexiang.xuidemo.fragment.expands.materialdesign.behavior.SimpleListFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tabsegment/TabSegmentScrollableModeFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tabsegment/TabSegmentScrollableModeFragment.java index 0320bc1d..44440c3f 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tabsegment/TabSegmentScrollableModeFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/tabbar/tabsegment/TabSegmentScrollableModeFragment.java @@ -33,7 +33,7 @@ import com.xuexiang.xui.widget.tabbar.TabSegment; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.HashMap; import java.util.Map; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/ExpandableTextViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/ExpandableTextViewFragment.java index eeddf8e5..0536798c 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/ExpandableTextViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/ExpandableTextViewFragment.java @@ -4,7 +4,7 @@ import com.xuexiang.xui.widget.textview.ExpandableTextView; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/ReadMoreTextViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/ReadMoreTextViewFragment.java new file mode 100644 index 00000000..74037d0c --- /dev/null +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/ReadMoreTextViewFragment.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 xuexiangjys(xuexiangjys@163.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.xuexiang.xuidemo.fragment.components.textview; + +import com.xuexiang.xpage.annotation.Page; +import com.xuexiang.xuidemo.R; +import com.xuexiang.xuidemo.base.BaseFragment; + +/** + * @author xuexiang + * @since 6/23/22 1:54 AM + */ +@Page(name = "ReadMoreTextView\n文字压缩显示控件") +public class ReadMoreTextViewFragment extends BaseFragment { + + + @Override + protected int getLayoutId() { + return R.layout.fragment_read_more_textview; + } + + @Override + protected void initViews() { + + } +} diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/supertextview/SuperClickFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/supertextview/SuperClickFragment.java index 6ccef8fd..862f517f 100755 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/supertextview/SuperClickFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/components/textview/supertextview/SuperClickFragment.java @@ -9,7 +9,7 @@ import com.xuexiang.xui.widget.textview.supertextview.SuperTextView; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/CityPickerFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/CityPickerFragment.java index b3d62852..ffee16b8 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/CityPickerFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/CityPickerFragment.java @@ -38,7 +38,7 @@ import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.LocationService; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/XQRCodeFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/XQRCodeFragment.java index 3cde3406..39ad9384 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/XQRCodeFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/XQRCodeFragment.java @@ -38,7 +38,7 @@ import com.xuexiang.xuidemo.fragment.expands.qrcode.CustomCaptureFragment; import com.xuexiang.xuidemo.fragment.expands.qrcode.QRCodeProduceFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.app.IntentUtils; import com.xuexiang.xutil.app.PathUtils; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/UltraViewPagerFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/UltraViewPagerFragment.java index ff14d675..4a6baa52 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/UltraViewPagerFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/UltraViewPagerFragment.java @@ -31,7 +31,7 @@ import com.xuexiang.xuidemo.adapter.UltraPagerAdapter; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.display.ScreenUtils; import butterknife.BindView; @@ -55,7 +55,7 @@ protected int getLayoutId() { protected void initViews() { ultraViewPager.setScrollMode(UltraViewPager.ScrollMode.HORIZONTAL); float scale = 0.5625F; - UltraPagerAdapter adapter = new UltraPagerAdapter(DemoDataProvider.getBannerList(), scale); + UltraPagerAdapter adapter = new UltraPagerAdapter(getContext(), DemoDataProvider.getBannerList(), scale); ultraViewPager.setAdapter(adapter); ultraViewPager.setMaxHeight((int) (ScreenUtils.getScreenWidth() * scale)); //指示器 @@ -64,8 +64,8 @@ protected void initViews() { .setOrientation(UltraViewPager.Orientation.HORIZONTAL) .setFocusColor(ThemeUtils.getMainThemeColor(getContext())) .setNormalColor(Color.WHITE) - .setMargin(DensityUtils.dp2px(10), DensityUtils.dp2px(10), DensityUtils.dp2px(10), DensityUtils.dp2px(10)) - .setRadius(DensityUtils.dp2px(5)); + .setMargin(DensityUtils.dp2px(getContext(), 10), DensityUtils.dp2px(getContext(), 10), DensityUtils.dp2px(getContext(), 10), DensityUtils.dp2px(getContext(), 10)) + .setRadius(DensityUtils.dp2px(getContext(), 5)); ultraViewPager.getIndicator().setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM); ultraViewPager.getIndicator().build(); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/VLayoutFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/VLayoutFragment.java index 0360f05a..42845551 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/VLayoutFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/VLayoutFragment.java @@ -45,7 +45,7 @@ import com.xuexiang.xuidemo.adapter.entity.NewInfo; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.display.ScreenUtils; import java.util.ArrayList; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/tangram/CustomAnnotationView.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/tangram/CustomAnnotationView.java index cac6431c..c14183c9 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/tangram/CustomAnnotationView.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/tangram/CustomAnnotationView.java @@ -33,7 +33,7 @@ import com.xuexiang.xui.utils.DensityUtils; import com.xuexiang.xui.utils.ViewUtils; import com.xuexiang.xuidemo.R; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.Locale; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/tangram/support/CustomClickSupport.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/tangram/support/CustomClickSupport.java index 0d7e3dde..6c5ac74b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/tangram/support/CustomClickSupport.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/alibaba/tangram/support/CustomClickSupport.java @@ -22,7 +22,7 @@ import com.tmall.wireless.tangram.structure.BaseCell; import com.tmall.wireless.tangram.support.SimpleClickSupport; import com.xuexiang.xaop.annotation.SingleClick; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; /** * 自定义点击事件 diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/calendar/DingDingCalendarFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/calendar/DingDingCalendarFragment.java index 4972bd14..2b6059c3 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/calendar/DingDingCalendarFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/calendar/DingDingCalendarFragment.java @@ -67,7 +67,7 @@ protected void initViews() { TextView textView; if (convertView == null) { convertView = LayoutInflater.from(parentView.getContext()).inflate(R.layout.adapter_calendar_item, null); - ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(DensityUtils.dp2px(48), DensityUtils.dp2px(48)); + ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(DensityUtils.dp2px(getContext(), 48), DensityUtils.dp2px(getContext(), 48)); convertView.setLayoutParams(params); } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/calendar/MaterialDesignCalendarFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/calendar/MaterialDesignCalendarFragment.java index a7c95533..acbf5c34 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/calendar/MaterialDesignCalendarFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/calendar/MaterialDesignCalendarFragment.java @@ -29,7 +29,7 @@ import com.xuexiang.xui.utils.ThemeUtils; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.Date; @@ -66,7 +66,7 @@ protected void initViews() { TextView textView; if (convertView == null) { convertView = LayoutInflater.from(parentView.getContext()).inflate(R.layout.adapter_calendar_item, null); - ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(DensityUtils.dp2px(48), DensityUtils.dp2px(48)); + ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(DensityUtils.dp2px(getContext(), 48), DensityUtils.dp2px(getContext(), 48)); convertView.setLayoutParams(params); } @@ -87,7 +87,10 @@ protected void initViews() { return convertView; }); - calendarDateView.setOnCalendarSelectedListener((view, postion, calendarDate) -> XToastUtils.toast("选中:" + calendarDate.formatDate())); + calendarDateView.setOnCalendarSelectedListener((view, position, calendarDate) -> { + XToastUtils.toast("选中:" + calendarDate.formatDate()); + view.setSelected(true); + }); calendarDateView.setOnTodaySelectStatusChangedListener((todayView, isSelected) -> { TextView view = todayView.findViewById(R.id.tv_text); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/camera/CameraActivity.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/camera/CameraActivity.java index 62857eb7..b840d072 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/camera/CameraActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/camera/CameraActivity.java @@ -37,7 +37,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.utils.RotateSensorHelper; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.StringUtils; import java.util.ArrayList; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/camera/CameraViewActivity.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/camera/CameraViewActivity.java index 225bd67e..d7c11db0 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/camera/CameraViewActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/camera/CameraViewActivity.java @@ -49,7 +49,7 @@ import com.xuexiang.xaop.annotation.SingleClick; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.StringUtils; import java.util.Set; @@ -151,6 +151,7 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode) { case REQUEST_CAMERA_PERMISSION: if (permissions.length != 1 || grantResults.length != 1) { diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/BaseChartFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/BaseChartFragment.java index 9b5c5e1f..c1035ec5 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/BaseChartFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/BaseChartFragment.java @@ -3,7 +3,7 @@ import com.github.mikephil.charting.charts.Chart; import com.xuexiang.xaop.annotation.Permission; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import static com.xuexiang.xaop.consts.PermissionConsts.STORAGE; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/bar/BasicBarChartFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/bar/BasicBarChartFragment.java index 5017c595..fa5a40a4 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/bar/BasicBarChartFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/bar/BasicBarChartFragment.java @@ -23,7 +23,7 @@ import com.xuexiang.xui.widget.dialog.bottomsheet.BottomSheet; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.fragment.expands.chart.BaseChartFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/line/BasicLineChartFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/line/BasicLineChartFragment.java index 0eb1ef9d..3e5b009d 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/line/BasicLineChartFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/line/BasicLineChartFragment.java @@ -26,7 +26,7 @@ import com.xuexiang.xui.widget.dialog.bottomsheet.BottomSheet; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.fragment.expands.chart.BaseChartFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/pie/BasicPieChartFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/pie/BasicPieChartFragment.java index b93c0c88..873b92f5 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/pie/BasicPieChartFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/pie/BasicPieChartFragment.java @@ -26,7 +26,7 @@ import com.xuexiang.xui.widget.dialog.bottomsheet.BottomSheet; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.fragment.expands.chart.BaseChartFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/pie/HalfPieChartFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/pie/HalfPieChartFragment.java index 06685871..a68ba8d2 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/pie/HalfPieChartFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/chart/pie/HalfPieChartFragment.java @@ -155,7 +155,7 @@ private SpannableString generateCenterSpannableText() { * 进行偏移,将宁外一半的圆弧隐藏掉 */ private void moveOffScreen() { - int height = DensityUtils.getDisplayMetrics().heightPixels; + int height = DensityUtils.getDisplayMetrics(getContext()).heightPixels; /* percent to move */ int offset = (int)(height * 0.65); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/iconfont/XUIIconFontDisplayFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/iconfont/XUIIconFontDisplayFragment.java index 4bbceb6b..3d08f5c6 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/iconfont/XUIIconFontDisplayFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/iconfont/XUIIconFontDisplayFragment.java @@ -46,7 +46,7 @@ protected int getLayoutId() { @Override protected void initViews() { - WidgetUtils.initGridRecyclerView(recyclerView, 3, DensityUtils.dp2px(2)); + WidgetUtils.initGridRecyclerView(recyclerView, 3, DensityUtils.dp2px(getContext(), 2)); recyclerView.setAdapter(new IconFontGridAdapter(XUIIconFont.Icon.values())); } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/BottomSheetDialogFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/BottomSheetDialogFragment.java index 2686bca4..31e318e1 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/BottomSheetDialogFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/BottomSheetDialogFragment.java @@ -110,7 +110,7 @@ private void initDialogList(RecyclerView recyclerView) { } private void initDialogGrid(RecyclerView recyclerView) { - WidgetUtils.initGridRecyclerView(recyclerView, 3, DensityUtils.dp2px(2)); + WidgetUtils.initGridRecyclerView(recyclerView, 3, DensityUtils.dp2px(getContext(), 2)); WidgetItemAdapter widgetItemAdapter = new WidgetItemAdapter(sortPageInfo(AppPageConfig.getInstance().getComponents())); recyclerView.setAdapter(widgetItemAdapter); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/ConstraintLayoutFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/ConstraintLayoutFragment.java index 5fca5882..3a7fd830 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/ConstraintLayoutFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/ConstraintLayoutFragment.java @@ -27,7 +27,7 @@ import com.xuexiang.xuidemo.fragment.expands.materialdesign.constraintlayout.ConstraintLayoutContainerFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.constraintlayout.ConstraintLayoutGroupFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.constraintlayout.ConstraintLayoutPlaceholderFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import java.util.List; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/DrawerLayoutFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/DrawerLayoutFragment.java index 27222704..fd0114ee 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/DrawerLayoutFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/DrawerLayoutFragment.java @@ -38,7 +38,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.fragment.expands.materialdesign.behavior.SimpleListFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.CollectionUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/ToolBarFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/ToolBarFragment.java index bce56572..0363f4d9 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/ToolBarFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/ToolBarFragment.java @@ -13,8 +13,7 @@ import com.xuexiang.xui.widget.popupwindow.popup.XUISimplePopup; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; -import com.xuexiang.xutil.common.StringUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.display.DensityUtils; import butterknife.BindView; @@ -75,21 +74,21 @@ private void initToolbar1() { toolBar1.setNavigationOnClickListener(onClickListener); toolBar1.setContentInsetStartWithNavigation(0); // 设置 toolbar 背景色 - toolBar1.setBackgroundColor(getResources().getColor(R.color.colorPrimary)); + toolBar1.setBackgroundColor(ResUtils.getColor(getContext(), R.color.colorPrimary)); // 设置 Title toolBar1.setTitle(R.string.title_toolbar); // 设置Toolbar title文字颜色 - toolBar1.setTitleTextColor(getResources().getColor(R.color.white)); + toolBar1.setTitleTextColor(ResUtils.getColor(getContext(), R.color.white)); // 设置Toolbar subTitle toolBar1.setSubtitle(R.string.title_toolbar_sub); - toolBar1.setSubtitleTextColor(getResources().getColor(R.color.white)); + toolBar1.setSubtitleTextColor(ResUtils.getColor(getContext(), R.color.white)); // 设置logo toolBar1.setLogo(R.mipmap.ic_launcher); //设置 Toolbar menu toolBar1.inflateMenu(R.menu.menu_custom); // 设置溢出菜单的图标 - toolBar1.setOverflowIcon(getResources().getDrawable(R.drawable.ic_navigation_more)); + toolBar1.setOverflowIcon(ResUtils.getDrawable(getContext(), R.drawable.ic_navigation_more)); // 设置menu item 点击事件 toolBar1.setOnMenuItemClickListener(menuItemClickListener); } @@ -138,7 +137,7 @@ public void onViewClicked(View view) { } private void showSelectPopWindow(View view) { - new XUISimplePopup<>(getContext(), ResUtils.getStringArray(R.array.grid_titles_entry)) + new XUISimplePopup<>(getContext(), ResUtils.getStringArray(getContext(), R.array.grid_titles_entry)) .create(DensityUtils.dip2px(getContext(), 170), (adapter, item, position) -> { ViewUtils.setText(tvSubTitle, String.format("<%s>", item)); }) diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/BottomNavigationViewBehaviorFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/BottomNavigationViewBehaviorFragment.java index fd5a09d6..0077c533 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/BottomNavigationViewBehaviorFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/BottomNavigationViewBehaviorFragment.java @@ -31,7 +31,7 @@ import com.xuexiang.xui.widget.actionbar.TitleBar; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.CollectionUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ComplexDetailsPageFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ComplexDetailsPageFragment.java index 7dc75748..f26352f5 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ComplexDetailsPageFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ComplexDetailsPageFragment.java @@ -31,7 +31,7 @@ import com.xuexiang.xui.widget.actionbar.TitleBar; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.display.Colors; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ComplexNestedScrollingFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ComplexNestedScrollingFragment.java index d6c1a22e..ae7d46fa 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ComplexNestedScrollingFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ComplexNestedScrollingFragment.java @@ -45,7 +45,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.fragment.components.tabbar.tabsegment.MultiPage; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xuidemo.widget.ComplexNestedScrollingLayout; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/RecyclerViewBehaviorFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/RecyclerViewBehaviorFragment.java index 45aad3d6..12896241 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/RecyclerViewBehaviorFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/RecyclerViewBehaviorFragment.java @@ -13,7 +13,7 @@ import com.xuexiang.xuidemo.adapter.NewsCardViewListAdapter; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xuidemo.widget.MaterialLoadMoreView; import com.yanzhenjie.recyclerview.SwipeRecyclerView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ToolbarBehaviorFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ToolbarBehaviorFragment.java index 9449b480..710c3292 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ToolbarBehaviorFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/behavior/ToolbarBehaviorFragment.java @@ -11,7 +11,7 @@ import com.xuexiang.xui.widget.actionbar.TitleBar; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.display.Colors; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/bottom/DemoBottomSheetDialog.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/bottom/DemoBottomSheetDialog.java index 1ac3691c..b5aefeb0 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/bottom/DemoBottomSheetDialog.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/materialdesign/bottom/DemoBottomSheetDialog.java @@ -96,7 +96,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat } private void initView(@NonNull View view) { - WidgetUtils.initGridRecyclerView(recyclerView, 3, DensityUtils.dp2px(2)); + WidgetUtils.initGridRecyclerView(recyclerView, 3, DensityUtils.dp2px(getContext(), 2)); WidgetItemAdapter widgetItemAdapter = new WidgetItemAdapter(sortPageInfo(AppPageConfig.getInstance().getComponents())); recyclerView.setAdapter(widgetItemAdapter); diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/CustomCaptureActivity.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/CustomCaptureActivity.java index 45618a2d..c1dfd9d3 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/CustomCaptureActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/CustomCaptureActivity.java @@ -32,7 +32,7 @@ import com.xuexiang.xqrcode.ui.CaptureActivity; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.StringUtils; import static com.xuexiang.xuidemo.base.webview.WebViewInterceptDialog.APP_LINK_ACTION; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/CustomCaptureFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/CustomCaptureFragment.java index 87f0af7b..fb5b5be6 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/CustomCaptureFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/CustomCaptureFragment.java @@ -31,7 +31,7 @@ import com.xuexiang.xqrcode.ui.CaptureFragment; import com.xuexiang.xqrcode.util.QRCodeAnalyzeUtils; import com.xuexiang.xuidemo.R; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/QRCodeProduceFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/QRCodeProduceFragment.java index 74c83683..7ae0214d 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/QRCodeProduceFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/qrcode/QRCodeProduceFragment.java @@ -39,7 +39,7 @@ import com.xuexiang.xqrcode.util.QRCodeProduceUtils; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.app.IntentUtils; import com.xuexiang.xutil.app.PathUtils; import com.xuexiang.xutil.common.StringUtils; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/JsWebViewFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/JsWebViewFragment.java index 54783876..e4d58808 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/JsWebViewFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/JsWebViewFragment.java @@ -29,7 +29,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.webview.BaseWebViewFragment; import com.xuexiang.xuidemo.utils.Utils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import org.json.JSONObject; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/TBSX5Fragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/TBSX5Fragment.java index d1d0f739..bd9f4fe4 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/TBSX5Fragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/TBSX5Fragment.java @@ -32,7 +32,7 @@ import com.xuexiang.xrouter.launcher.XRouter; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/TbsWebFileReaderFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/TbsWebFileReaderFragment.java index 1397a8cf..3c0b59ef 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/TbsWebFileReaderFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/expands/webview/TbsWebFileReaderFragment.java @@ -35,7 +35,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.base.webview.x5.FileReaderView; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.app.IntentUtils; import com.xuexiang.xutil.file.FileUtils; import com.zhy.http.okhttp.OkHttpUtils; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/other/LoginFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/other/LoginFragment.java index c4d1f84e..1ba8d7ba 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/other/LoginFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/other/LoginFragment.java @@ -39,7 +39,7 @@ import com.xuexiang.xuidemo.utils.PrivacyUtils; import com.xuexiang.xuidemo.utils.SettingSPUtils; import com.xuexiang.xuidemo.utils.TokenUtils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xuidemo.utils.sdkinit.UMengInit; import com.xuexiang.xutil.app.ActivityUtils; import com.xuexiang.xutil.common.RandomUtils; @@ -133,10 +133,10 @@ public void onViewClicked(View view) { XToastUtils.info("忘记密码"); break; case R.id.tv_user_protocol: - openPage(ServiceProtocolFragment.class, KEY_PROTOCOL_TITLE, ResUtils.getString(R.string.title_user_protocol)); + openPage(ServiceProtocolFragment.class, KEY_PROTOCOL_TITLE, ResUtils.getString(getContext(), R.string.title_user_protocol)); break; case R.id.tv_privacy_protocol: - openPage(ServiceProtocolFragment.class, KEY_PROTOCOL_TITLE, ResUtils.getString(R.string.title_privacy_protocol)); + openPage(ServiceProtocolFragment.class, KEY_PROTOCOL_TITLE, ResUtils.getString(getContext(), R.string.title_privacy_protocol)); break; default: break; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/other/QRCodeFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/other/QRCodeFragment.java index 74602339..9690e35d 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/other/QRCodeFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/other/QRCodeFragment.java @@ -33,7 +33,7 @@ import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.base.webview.AgentWebActivity; import com.xuexiang.xuidemo.fragment.components.imageview.DrawablePreviewFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.app.PathUtils; import com.xuexiang.xutil.app.SocialShareUtils; import com.xuexiang.xutil.display.ImageUtils; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/other/SponsorFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/other/SponsorFragment.java index 9ab1906d..0e26db05 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/other/SponsorFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/other/SponsorFragment.java @@ -35,7 +35,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; import com.xuexiang.xuidemo.fragment.components.imageview.DrawablePreviewFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.app.PathUtils; import com.xuexiang.xutil.app.SocialShareUtils; import com.xuexiang.xutil.display.ImageUtils; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/KeyBoardUtilsFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/KeyBoardUtilsFragment.java index 1ebc313f..d34d91f2 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/KeyBoardUtilsFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/KeyBoardUtilsFragment.java @@ -29,7 +29,7 @@ import com.xuexiang.xui.widget.button.switchbutton.SwitchButton; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/ShortcutUtilsFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/ShortcutUtilsFragment.java index 88b3260b..a6e64352 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/ShortcutUtilsFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/ShortcutUtilsFragment.java @@ -79,7 +79,7 @@ private void createSearchShortcut() { ShortcutUtils.addPinShortcut(getContext(), SearchComponentActivity.class, "shortcut_search_id", - R.drawable.ic_action_search, ResUtils.getString(R.string.shortcut_label_search), ShortcutReceiver.class); + R.drawable.ic_action_search, ResUtils.getString(getContext(), R.string.shortcut_label_search), ShortcutReceiver.class); } /** @@ -89,6 +89,6 @@ private void createSettingShortcut() { ShortcutUtils.addPinShortcut(getContext(), SettingsActivity.class, "shortcut_setting_id", - R.drawable.ic_action_setting, ResUtils.getString(R.string.shortcut_label_setting), ShortcutReceiver.class); + R.drawable.ic_action_setting, ResUtils.getString(getContext(), R.string.shortcut_label_setting), ShortcutReceiver.class); } } diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/SnackBarUtilsFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/SnackBarUtilsFragment.java index 5f6158ce..c1b2533e 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/SnackBarUtilsFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/SnackBarUtilsFragment.java @@ -27,7 +27,7 @@ import com.xuexiang.xui.utils.SnackbarUtils; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.OnClick; @@ -64,7 +64,7 @@ public void onClickDuring(View view) { break; case R.id.btn_indefinite: SnackbarUtils.Indefinite(view, "显示时长:无限 + info").info() - .actionColor(ResUtils.getColor(R.color.xui_config_color_white)) + .actionColor(ResUtils.getColor(getContext(), R.color.xui_config_color_white)) .setAction("确定", v -> XToastUtils.toast("点击了确定!")).show(); break; case R.id.btn_length_custom: diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/StatusBarUtilsFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/StatusBarUtilsFragment.java index dbc3008a..c8ec025f 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/StatusBarUtilsFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/StatusBarUtilsFragment.java @@ -11,7 +11,7 @@ import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.activity.TranslucentActivity; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.app.ActivityUtils; import butterknife.BindView; diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/shortcut/ShortcutReceiver.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/shortcut/ShortcutReceiver.java index d469a98e..616967ea 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/shortcut/ShortcutReceiver.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/shortcut/ShortcutReceiver.java @@ -21,7 +21,7 @@ import android.content.Context; import android.content.Intent; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.common.logger.Logger; /** diff --git a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/view/ViewPaddingFragment.java b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/view/ViewPaddingFragment.java index add0376e..3b706099 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/view/ViewPaddingFragment.java +++ b/app/src/main/java/com/xuexiang/xuidemo/fragment/utils/view/ViewPaddingFragment.java @@ -24,7 +24,7 @@ import com.xuexiang.xui.utils.ViewUtils; import com.xuexiang.xuidemo.R; import com.xuexiang.xuidemo.base.BaseFragment; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import butterknife.BindView; import butterknife.OnClick; diff --git a/app/src/main/java/com/xuexiang/xuidemo/utils/PrivacyUtils.java b/app/src/main/java/com/xuexiang/xuidemo/utils/PrivacyUtils.java index 0424f95f..f573d982 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/utils/PrivacyUtils.java +++ b/app/src/main/java/com/xuexiang/xuidemo/utils/PrivacyUtils.java @@ -69,15 +69,15 @@ public static Dialog showPrivacyDialog(Context context, MaterialDialog.SingleBut }) .negativeText(R.string.lab_disagree).onNegative((dialog16, which) -> { dialog16.dismiss(); - DialogLoader.getInstance().showConfirmDialog(context, ResUtils.getString(R.string.title_reminder), String.format(ResUtils.getString(R.string.content_privacy_explain_again), ResUtils.getString(R.string.app_name)), ResUtils.getString(R.string.lab_look_again), (dialog15, which14) -> { + DialogLoader.getInstance().showConfirmDialog(context, ResUtils.getString(context, R.string.title_reminder), String.format(ResUtils.getString(context, R.string.content_privacy_explain_again), ResUtils.getString(context, R.string.app_name)), ResUtils.getString(context, R.string.lab_look_again), (dialog15, which14) -> { dialog15.dismiss(); showPrivacyDialog(context, submitListener); - }, ResUtils.getString(R.string.lab_still_disagree), (dialog14, which13) -> { + }, ResUtils.getString(context, R.string.lab_still_disagree), (dialog14, which13) -> { dialog14.dismiss(); - DialogLoader.getInstance().showConfirmDialog(context, ResUtils.getString(R.string.content_think_about_it_again), ResUtils.getString(R.string.lab_look_again), (dialog13, which12) -> { + DialogLoader.getInstance().showConfirmDialog(context, ResUtils.getString(context, R.string.content_think_about_it_again), ResUtils.getString(context, R.string.lab_look_again), (dialog13, which12) -> { dialog13.dismiss(); showPrivacyDialog(context, submitListener); - }, ResUtils.getString(R.string.lab_exit_app), (dialog12, which1) -> { + }, ResUtils.getString(context, R.string.lab_exit_app), (dialog12, which1) -> { dialog12.dismiss(); XUtil.exitApp(); }); @@ -97,7 +97,7 @@ public static Dialog showPrivacyDialog(Context context, MaterialDialog.SingleBut */ private static SpannableStringBuilder getPrivacyContent(Context context) { SpannableStringBuilder stringBuilder = new SpannableStringBuilder() - .append(" 欢迎来到").append(ResUtils.getString(R.string.app_name)).append("!\n") + .append(" 欢迎来到").append(ResUtils.getString(context, R.string.app_name)).append("!\n") .append(" 我们深知个人信息对你的重要性,也感谢你对我们的信任。\n") .append(" 为了更好地保护你的权益,同时遵守相关监管的要求,我们将通过"); stringBuilder.append(getPrivacyLink(context, PRIVACY_URL)) @@ -113,7 +113,7 @@ private static SpannableStringBuilder getPrivacyContent(Context context) { * @return */ private static SpannableString getPrivacyLink(Context context, String privacyUrl) { - String privacyName = String.format(ResUtils.getString(R.string.lab_privacy_name), ResUtils.getString(R.string.app_name)); + String privacyName = String.format(ResUtils.getString(context, R.string.lab_privacy_name), ResUtils.getString(context, R.string.app_name)); SpannableString spannableString = new SpannableString(privacyName); spannableString.setSpan(new ClickableSpan() { @Override diff --git a/app/src/main/java/com/xuexiang/xuidemo/utils/TokenUtils.java b/app/src/main/java/com/xuexiang/xuidemo/utils/TokenUtils.java index e3a2a669..2d111c4e 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/utils/TokenUtils.java +++ b/app/src/main/java/com/xuexiang/xuidemo/utils/TokenUtils.java @@ -21,6 +21,7 @@ import com.tencent.mmkv.MMKV; import com.umeng.analytics.MobclickAgent; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xuidemo.activity.LoginActivity; import com.xuexiang.xutil.app.ActivityUtils; import com.xuexiang.xutil.common.StringUtils; diff --git a/app/src/main/java/com/xuexiang/xuidemo/utils/sdkinit/XBasicLibInit.java b/app/src/main/java/com/xuexiang/xuidemo/utils/sdkinit/XBasicLibInit.java index 85ea11b6..29c24e59 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/utils/sdkinit/XBasicLibInit.java +++ b/app/src/main/java/com/xuexiang/xuidemo/utils/sdkinit/XBasicLibInit.java @@ -27,9 +27,8 @@ import com.xuexiang.xuidemo.MyApp; import com.xuexiang.xuidemo.base.BaseActivity; import com.xuexiang.xuidemo.base.db.InternalDataBase; -import com.xuexiang.xuidemo.utils.LocationService; import com.xuexiang.xuidemo.utils.TokenUtils; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xutil.XUtil; import com.xuexiang.xutil.common.StringUtils; diff --git a/app/src/main/java/com/xuexiang/xuidemo/utils/update/CustomUpdateFailureListener.java b/app/src/main/java/com/xuexiang/xuidemo/utils/update/CustomUpdateFailureListener.java index 8b740313..8058c654 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/utils/update/CustomUpdateFailureListener.java +++ b/app/src/main/java/com/xuexiang/xuidemo/utils/update/CustomUpdateFailureListener.java @@ -1,6 +1,6 @@ package com.xuexiang.xuidemo.utils.update; -import com.xuexiang.xuidemo.utils.XToastUtils; +import com.xuexiang.xui.utils.XToastUtils; import com.xuexiang.xupdate.entity.UpdateError; import com.xuexiang.xupdate.listener.OnUpdateFailureListener; diff --git a/app/src/main/java/com/xuexiang/xuidemo/widget/iconfont/IconFontActivity.java b/app/src/main/java/com/xuexiang/xuidemo/widget/iconfont/IconFontActivity.java index 9da1830c..ae66f41b 100644 --- a/app/src/main/java/com/xuexiang/xuidemo/widget/iconfont/IconFontActivity.java +++ b/app/src/main/java/com/xuexiang/xuidemo/widget/iconfont/IconFontActivity.java @@ -125,7 +125,7 @@ protected void registerSlideBack() { if (isSupportSlideBack()) { SlideBack.withFixSize(this) .haveScroll(true) - .edgeMode(ResUtils.isRtl() ? SlideBack.EDGE_RIGHT : SlideBack.EDGE_LEFT) + .edgeMode(ResUtils.isRtl(this) ? SlideBack.EDGE_RIGHT : SlideBack.EDGE_LEFT) .callBack(this::popPage) .register(); } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 1a896c54..a3879bad 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -36,6 +36,7 @@ style="@style/TabLayoutStyle" android:layout_width="match_parent" android:layout_height="?attr/xui_actionbar_height" + android:contentDescription="@string/description_navigation_main" app:tabBackground="@null" app:tabGravity="fill" app:tabIndicatorColor="@color/xui_config_color_transparent" diff --git a/app/src/main/res/layout/dialog_custom.xml b/app/src/main/res/layout/dialog_custom.xml index 3d9f4ecc..3c04bb67 100644 --- a/app/src/main/res/layout/dialog_custom.xml +++ b/app/src/main/res/layout/dialog_custom.xml @@ -65,4 +65,12 @@ app:mpb_progressStyle="horizontal" style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal" /> + + + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_drawable_utils_createfromview.xml b/app/src/main/res/layout/dialog_drawable_utils_createfromview.xml index 97cbbbd6..cdac8e33 100644 --- a/app/src/main/res/layout/dialog_drawable_utils_createfromview.xml +++ b/app/src/main/res/layout/dialog_drawable_utils_createfromview.xml @@ -28,7 +28,7 @@ android:adjustViewBounds="true" android:scaleType="fitXY" android:background="@color/xui_config_color_gray_3" - android:contentDescription="截图当前界面显示" + android:contentDescription="@string/description_create_from_view_display" android:padding="1px" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_behavior_recyclerview.xml b/app/src/main/res/layout/fragment_behavior_recyclerview.xml index c40a1584..c0630450 100644 --- a/app/src/main/res/layout/fragment_behavior_recyclerview.xml +++ b/app/src/main/res/layout/fragment_behavior_recyclerview.xml @@ -30,6 +30,7 @@ android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/spacing_16" + android:contentDescription="@string/description_demo" android:src="@drawable/ic_add_white_24dp" app:layout_behavior="com.xuexiang.xuidemo.widget.FabBehavior" /> diff --git a/app/src/main/res/layout/fragment_bottom_navigationview_behavior.xml b/app/src/main/res/layout/fragment_bottom_navigationview_behavior.xml index 9b2e962a..1a4dfd87 100644 --- a/app/src/main/res/layout/fragment_bottom_navigationview_behavior.xml +++ b/app/src/main/res/layout/fragment_bottom_navigationview_behavior.xml @@ -40,6 +40,7 @@ android:id="@+id/view_pager" android:layout_width="match_parent" android:layout_height="match_parent" + android:contentDescription="@string/description_demo" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> diff --git a/app/src/main/res/layout/fragment_marqueen.xml b/app/src/main/res/layout/fragment_marqueen.xml index 1ee44e5e..db2dc72e 100755 --- a/app/src/main/res/layout/fragment_marqueen.xml +++ b/app/src/main/res/layout/fragment_marqueen.xml @@ -54,5 +54,14 @@ app:mtv_isAutoFit="true" app:mtv_isAutoDisplay="true"/> + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_read_more_textview.xml b/app/src/main/res/layout/fragment_read_more_textview.xml new file mode 100644 index 00000000..5390a51c --- /dev/null +++ b/app/src/main/res/layout/fragment_read_more_textview.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_simple_tab.xml b/app/src/main/res/layout/fragment_simple_tab.xml index 6c05d791..6376f531 100644 --- a/app/src/main/res/layout/fragment_simple_tab.xml +++ b/app/src/main/res/layout/fragment_simple_tab.xml @@ -38,4 +38,12 @@ android:layout_marginTop="20dp" tools:text="这里是xx页面描述" /> + +