├── .gitignore ├── .idea ├── caches │ ├── build_file_checksums.ser │ └── gradle_models.ser ├── dictionaries │ └── apple.xml ├── gradle.xml ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── apk │ └── app-debug.apk ├── build.gradle ├── proguard-rules.pro ├── release │ ├── app-release.apk │ └── output.json ├── screenshots │ ├── 1.png │ ├── 2.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── ios.png │ ├── popup.png │ ├── progress.png │ ├── update.png │ ├── xianyu.png │ └── xianyu2.gif └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── example │ │ └── windowshowdemo │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── windowshowdemo │ │ │ ├── BottomDialog.java │ │ │ ├── DeviceHelper.java │ │ │ ├── DisplayHelper.java │ │ │ ├── FilterDropDownDialog.java │ │ │ ├── GalleryBean.java │ │ │ ├── GridSpacingItemDecoration.java │ │ │ ├── IOUtils.java │ │ │ ├── LikeXianYuActivity.java │ │ │ ├── ListPopWindow.java │ │ │ ├── MainActivity.java │ │ │ ├── MyAttrsUtils.java │ │ │ ├── NoScrollViewPager.java │ │ │ ├── NotchHelper.java │ │ │ ├── PopNiceActivity.java │ │ │ ├── ShowEnjoyDialogFragment.java │ │ │ ├── StatusBarHelper.java │ │ │ ├── TopViewActivity.java │ │ │ ├── UIUtils.java │ │ │ ├── delay │ │ │ └── DelayDialogActivity.java │ │ │ ├── dialog │ │ │ ├── ContentDialog.java │ │ │ └── DialogActivity.java │ │ │ ├── dialogfragment │ │ │ ├── BaseDialogFragment.java │ │ │ ├── Local.java │ │ │ └── UpdateFragment.java │ │ │ ├── like_alert │ │ │ ├── SimpleController.java │ │ │ ├── SimpleDialog.java │ │ │ ├── SimpleListener.java │ │ │ └── 说明.txt │ │ │ ├── like_ios │ │ │ └── TipDialog.java │ │ │ ├── like_qianchen │ │ │ ├── FilterHeadView.java │ │ │ └── QianchengFilterActivity.java │ │ │ ├── loading │ │ │ ├── PaintDrawable.java │ │ │ ├── ProgressDrawable.java │ │ │ └── StaticLoadActivity.java │ │ │ ├── model │ │ │ └── EnjoyBean.java │ │ │ ├── popup │ │ │ ├── LargePopupWindow.java │ │ │ └── PopupWindowActivity.java │ │ │ ├── toast │ │ │ └── MyToast.java │ │ │ └── xianyu │ │ │ └── PubActivity.java │ └── res │ │ ├── anim │ │ ├── dd_mask_in.xml │ │ ├── dd_mask_out.xml │ │ ├── dd_menu_in.xml │ │ ├── dd_menu_out.xml │ │ ├── push_bottom_in.xml │ │ ├── push_bottom_out.xml │ │ ├── push_top_in.xml │ │ ├── push_top_out.xml │ │ ├── slide_in_from_bottom.xml │ │ └── slide_out_to_bottom.xml │ │ ├── color │ │ └── navigator_color.xml │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xxhdpi │ │ ├── comui_tab_home.png │ │ ├── comui_tab_home_selected.png │ │ ├── comui_tab_message.png │ │ ├── comui_tab_message_selected.png │ │ ├── comui_tab_person.png │ │ ├── comui_tab_person_selected.png │ │ ├── comui_tab_pond.png │ │ ├── comui_tab_pond_selected.png │ │ ├── comui_tab_post.png │ │ └── lib_update_app_info_bg.xml │ │ ├── drawable │ │ ├── bg_dialog_delay.xml │ │ ├── bg_dialog_tip.xml │ │ ├── bg_enjoy_normal.xml │ │ ├── bg_enjoy_pink.xml │ │ ├── bg_item_selected.xml │ │ ├── bg_pub.xml │ │ ├── bg_pub_article.xml │ │ ├── bg_pub_blog.xml │ │ ├── bg_pub_tweet.xml │ │ ├── bg_pub_write.xml │ │ ├── bg_toast.xml │ │ ├── btn_border.xml │ │ ├── btn_border_nativephoto.xml │ │ ├── btn_border_takephoto.xml │ │ ├── button_selector.xml │ │ ├── button_yellow_selector.xml │ │ ├── contact_select.png │ │ ├── contact_select_checkbox.xml │ │ ├── contact_selected.png │ │ ├── dialog_arrow.png │ │ ├── dialog_loading.xml │ │ ├── dialog_loading2.xml │ │ ├── dialog_loading3.xml │ │ ├── dialog_loading4.xml │ │ ├── dialog_loading5.xml │ │ ├── dialog_loading6.xml │ │ ├── dialog_loading_img.png │ │ ├── esf_call_dialog_toast_bg.xml │ │ ├── houseajk_bottom_devider.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_nav_add_normal.xml │ │ ├── selector_home.xml │ │ ├── selector_message.xml │ │ ├── selector_person.xml │ │ ├── selector_pond.xml │ │ ├── shop.jpg │ │ ├── tribe_coin.png │ │ └── tribe_toast_dialog.xml │ │ ├── layout │ │ ├── activity_delay_dialog.xml │ │ ├── activity_dialog.xml │ │ ├── activity_like_xian_yu.xml │ │ ├── activity_main.xml │ │ ├── activity_pop_nice.xml │ │ ├── activity_popup_window.xml │ │ ├── activity_pub.xml │ │ ├── activity_qiancheng_filter.xml │ │ ├── activity_static_load.xml │ │ ├── activity_top_view.xml │ │ ├── bottom_photo.xml │ │ ├── bottom_purchase.xml │ │ ├── delay_dialog.xml │ │ ├── dialog_content.xml │ │ ├── dialog_purchase.xml │ │ ├── dialog_simple.xml │ │ ├── dialog_tip.xml │ │ ├── filter_drop_down_layout.xml │ │ ├── fragment_dialog_show_enjoy.xml │ │ ├── item_enjoy_text.xml │ │ ├── item_pic_pop_show.xml │ │ ├── layout_filter_view.xml │ │ ├── lib_update_app_dialog.xml │ │ ├── pop_below_head.xml │ │ ├── pop_my_show.xml │ │ ├── test_clip.xml │ │ ├── toast_layout.xml │ │ └── toolbar.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_arrow_bottom.png │ │ ├── ic_arrow_top.png │ │ ├── ic_back2.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ ├── ic_top_hong.png │ │ └── lib_update_app_top_bg.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── buy_delete.png │ │ ├── feedback_submit_loading.png │ │ ├── home_down_arrow.png │ │ ├── home_down_arrow_red.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ ├── im_chatroom_msg_loading.png │ │ ├── lib_update_app_close.png │ │ ├── p_load_demo_img.png │ │ ├── p_progress_round_icon.png │ │ ├── pay58sdk_icon_loading.png │ │ ├── pay58sdk_icon_loading_small.png │ │ └── publicloading1.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── top_8.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ ├── ic_new_article.png │ │ ├── ic_new_blog.png │ │ └── ic_new_tweet.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── example │ └── windowshowdemo │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /.idea/dictionaries/apple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 26 | 41 | 42 | 43 | 44 | 45 | 46 | 48 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/apk/app-debug.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/apk/app-debug.apk -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | defaultConfig { 6 | applicationId "com.example.windowshowdemo" 7 | minSdkVersion 16 8 | targetSdkVersion 26 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | 20 | // 强制让所有模块都用相同的支持库版本。 21 | configurations.all { 22 | resolutionStrategy.eachDependency { DependencyResolveDetails details -> 23 | def requested = details.requested 24 | if (requested.group == 'com.android.support') { 25 | if (!requested.name.startsWith("multidex")) { 26 | details.useVersion '26.1.0' 27 | } 28 | } 29 | } 30 | } 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(dir: 'libs', include: ['*.jar']) 35 | implementation 'com.android.support:appcompat-v7:26.1.0' 36 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 37 | implementation 'com.android.support:design:26.1.0' 38 | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30' 39 | implementation 'com.silencedut:router:1.3.0' 40 | implementation 'com.android.support:cardview-v7:26.1.0' 41 | 42 | // 版本很高 43 | implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.2.3' 44 | // butterknife 45 | implementation 'com.jakewharton:butterknife:8.8.1' 46 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/release/app-release.apk -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"com.example.windowshowdemo","split":"","minSdkVersion":"16"}}] -------------------------------------------------------------------------------- /app/screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/1.png -------------------------------------------------------------------------------- /app/screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/2.png -------------------------------------------------------------------------------- /app/screenshots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/4.png -------------------------------------------------------------------------------- /app/screenshots/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/5.png -------------------------------------------------------------------------------- /app/screenshots/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/6.png -------------------------------------------------------------------------------- /app/screenshots/ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/ios.png -------------------------------------------------------------------------------- /app/screenshots/popup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/popup.png -------------------------------------------------------------------------------- /app/screenshots/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/progress.png -------------------------------------------------------------------------------- /app/screenshots/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/update.png -------------------------------------------------------------------------------- /app/screenshots/xianyu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/xianyu.png -------------------------------------------------------------------------------- /app/screenshots/xianyu2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/screenshots/xianyu2.gif -------------------------------------------------------------------------------- /app/src/androidTest/java/com/example/windowshowdemo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.example.windowshowdemo", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 14 | 15 | 16 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/BottomDialog.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.content.Context; 4 | import android.content.DialogInterface; 5 | import android.support.annotation.NonNull; 6 | import android.support.design.widget.BottomSheetBehavior; 7 | import android.support.design.widget.BottomSheetDialog; 8 | import android.support.design.widget.CoordinatorLayout; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.view.Window; 12 | import android.view.WindowManager; 13 | 14 | /** 15 | * @author crazyZhangxl on 2018/10/25. 16 | */ 17 | 18 | public class BottomDialog extends BottomSheetDialog { 19 | 20 | private BottomSheetBehavior behavior; 21 | 22 | public BottomDialog(@NonNull Context context, int theme, boolean isTranslucentStatus) { 23 | super(context, theme); 24 | Window window = getWindow(); 25 | if (window != null) { 26 | window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | 27 | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); 28 | if (isTranslucentStatus) { 29 | window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 30 | } 31 | } 32 | } 33 | 34 | @Override 35 | public void setContentView(View view) { 36 | super.setContentView(view); 37 | initialize(view); 38 | setOnDismissListener(new DialogInterface.OnDismissListener() { 39 | @Override 40 | public void onDismiss(DialogInterface dialog) { 41 | if (behavior != null) { 42 | behavior.setState(BottomSheetBehavior.STATE_COLLAPSED); 43 | } 44 | } 45 | }); 46 | } 47 | 48 | @Override 49 | public void show() { 50 | super.show(); 51 | behavior.setState(BottomSheetBehavior.STATE_EXPANDED); 52 | } 53 | 54 | private void initialize(final View view) { 55 | ViewGroup parent = (ViewGroup) view.getParent(); 56 | CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) parent.getLayoutParams(); 57 | behavior = (BottomSheetBehavior) params.getBehavior(); 58 | if (behavior == null) { 59 | return; 60 | } 61 | behavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { 62 | @Override 63 | public void onStateChanged(@NonNull View bottomSheet, int newState) { 64 | if (newState == BottomSheetBehavior.STATE_HIDDEN) { 65 | dismiss(); 66 | behavior.setState(BottomSheetBehavior.STATE_COLLAPSED); 67 | } 68 | } 69 | 70 | @Override 71 | public void onSlide(@NonNull View bottomSheet, float slideOffset) { 72 | } 73 | }); 74 | } 75 | } 76 | 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/FilterDropDownDialog.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.content.Context; 4 | import android.graphics.drawable.Drawable; 5 | import android.support.annotation.NonNull; 6 | import android.support.v4.content.ContextCompat; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.view.animation.Animation; 11 | import android.view.animation.AnimationUtils; 12 | import android.widget.FrameLayout; 13 | import android.widget.TextView; 14 | import android.widget.Toast; 15 | 16 | /** 17 | * @author crazyZhangxl on 2018/10/29. 18 | * Describe: 19 | */ 20 | public class FilterDropDownDialog extends FrameLayout implements View.OnClickListener { 21 | private Animation mAnimationIn; 22 | private Animation mAnimationOut; 23 | private Animation mMaskAnimationIn; 24 | private Animation mMaskAnimationOut; 25 | private View mContentFrame; 26 | private View maskView; 27 | private boolean isShow; 28 | private TextView mTextView; 29 | private Drawable drawableUp, drawableDown; 30 | public FilterDropDownDialog(@NonNull Context context, FrameLayout frameLayout, TextView textView) { 31 | super(context); 32 | initView(context); 33 | mTextView = textView; 34 | // 将布局加入,也就是将遮层布局放置在该布局之上 35 | frameLayout.addView(this, 36 | new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); 37 | } 38 | 39 | private void initView(Context mContext) { 40 | View view = LayoutInflater.from(mContext).inflate(R.layout.filter_drop_down_layout, null); 41 | maskView = view.findViewById(R.id.mask); 42 | mContentFrame = view.findViewById(R.id.contentFm); 43 | maskView.setOnClickListener(this); 44 | mContentFrame.setOnClickListener(this); 45 | addView(view); 46 | drawableUp = ContextCompat.getDrawable(mContext, R.mipmap.ic_arrow_top); 47 | drawableDown = ContextCompat.getDrawable(mContext, R.mipmap.ic_arrow_bottom); 48 | mAnimationIn = AnimationUtils.loadAnimation(mContext,R.anim.dd_menu_in); 49 | mAnimationOut = AnimationUtils.loadAnimation(mContext,R.anim.dd_menu_out); 50 | mMaskAnimationIn = AnimationUtils.loadAnimation(mContext,R.anim.dd_mask_in); 51 | mMaskAnimationOut = AnimationUtils.loadAnimation(mContext,R.anim.dd_mask_out); 52 | setVisibility(GONE); 53 | } 54 | 55 | @Override 56 | public void onClick(View v) { 57 | switch (v.getId()){ 58 | case R.id.mask: 59 | dismiss(); 60 | break; 61 | case R.id.contentFm: 62 | Toast.makeText(getContext(), "点击内容", Toast.LENGTH_SHORT).show(); 63 | break; 64 | default: 65 | break; 66 | } 67 | } 68 | 69 | public void dismiss(){ 70 | isShow = false; 71 | mContentFrame.setVisibility(GONE); 72 | mContentFrame.startAnimation(mAnimationOut); 73 | maskView.setVisibility(GONE); 74 | maskView.startAnimation(mMaskAnimationOut); 75 | UIUtils.modifyTextViewDrawable(mTextView, drawableDown, 2); 76 | } 77 | 78 | public void show(){ 79 | isShow = true; 80 | setVisibility(VISIBLE); 81 | mContentFrame.setVisibility(VISIBLE); 82 | mContentFrame.startAnimation(mAnimationIn); 83 | maskView.setVisibility(VISIBLE); 84 | maskView.startAnimation(mMaskAnimationIn); 85 | UIUtils.modifyTextViewDrawable(mTextView, drawableUp, 2); 86 | } 87 | 88 | public boolean isHasShow(){ 89 | return isShow; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/GalleryBean.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | /** 4 | * @author zxl on 2018/6/28. 5 | * discription: 6 | */ 7 | 8 | public class GalleryBean { 9 | private String mTitle; 10 | private boolean isChecked; 11 | 12 | public GalleryBean(String title) { 13 | mTitle = title; 14 | } 15 | 16 | public String getTitle() { 17 | return mTitle; 18 | } 19 | 20 | public void setTitle(String title) { 21 | mTitle = title; 22 | } 23 | 24 | public boolean isChecked() { 25 | return isChecked; 26 | } 27 | 28 | public void setChecked(boolean checked) { 29 | isChecked = checked; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/GridSpacingItemDecoration.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.graphics.Rect; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.View; 6 | 7 | /** 8 | * @author zxl on 2018/7/25. 9 | * discription: 10 | */ 11 | 12 | public class GridSpacingItemDecoration extends RecyclerView.ItemDecoration { 13 | 14 | private int spanCount; 15 | private int spacing; 16 | private boolean includeEdge; 17 | 18 | public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) { 19 | this.spanCount = spanCount; 20 | this.spacing = spacing; 21 | this.includeEdge = includeEdge; 22 | } 23 | 24 | @Override 25 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { 26 | int position = parent.getChildAdapterPosition(view); // item position 27 | int column = position % spanCount; // item column 28 | 29 | if (includeEdge) { 30 | outRect.left = spacing - column * spacing / spanCount; // spacing - column * ((1f / spanCount) * spacing) 31 | outRect.right = (column + 1) * spacing / spanCount; // (column + 1) * ((1f / spanCount) * spacing) 32 | 33 | if (position < spanCount) { // top edge 34 | outRect.top = spacing; 35 | } 36 | outRect.bottom = spacing; // item bottom 37 | } else { 38 | outRect.left = column * spacing / spanCount; // column * ((1f / spanCount) * spacing) 39 | outRect.right = spacing - (column + 1) * spacing / spanCount; // spacing - (column + 1) * ((1f / spanCount) * spacing) 40 | if (position >= spanCount) { 41 | outRect.top = spacing; // item top 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/IOUtils.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | import java.io.Closeable; 3 | import java.io.IOException; 4 | 5 | /** 6 | * @author zxl 7 | * @描述 IO流工具类 8 | */ 9 | public class IOUtils { 10 | /** 11 | * 安全的关闭一个文件 内置try-catch 12 | * @param io 13 | */ 14 | public static boolean close(Closeable io) { 15 | if (io != null) { 16 | try { 17 | io.close(); 18 | } catch (IOException e) { 19 | e.printStackTrace(); 20 | } 21 | } 22 | return true; 23 | } 24 | 25 | 26 | 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/LikeXianYuActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.graphics.drawable.Drawable; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | import android.widget.RadioButton; 9 | import android.widget.RadioGroup; 10 | import android.widget.TextView; 11 | import android.widget.Toast; 12 | 13 | import com.example.windowshowdemo.xianyu.PubActivity; 14 | 15 | /** 16 | * 仿咸鱼底部菜单界面效果 17 | */ 18 | public class LikeXianYuActivity extends AppCompatActivity { 19 | private RadioButton mRbHome,mRbPond,mRbPerson,mRbMsg; 20 | private RadioGroup mRbGroup; 21 | private ImageView mIvAdd; 22 | private TextView mTVDes; 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_like_xian_yu); 27 | initViews(); 28 | initListener(); 29 | mRbHome.setChecked(true); 30 | } 31 | 32 | private void initListener() { 33 | mRbGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { 34 | @Override 35 | public void onCheckedChanged(RadioGroup group, int checkedId) { 36 | String text =""; 37 | switch (checkedId){ 38 | case R.id.rb_home: 39 | text ="闲鱼"; 40 | break; 41 | case R.id.rb_me: 42 | text ="我的"; 43 | break; 44 | case R.id.rb_message: 45 | text = "消息"; 46 | break; 47 | case R.id.rb_pond: 48 | text = "鱼塘"; 49 | break; 50 | default: 51 | break; 52 | } 53 | mTVDes.setText(text); 54 | } 55 | }); 56 | 57 | mIvAdd.setOnClickListener(new View.OnClickListener() { 58 | @Override 59 | public void onClick(View v) { 60 | PubActivity.show(LikeXianYuActivity.this); 61 | } 62 | }); 63 | 64 | } 65 | 66 | private void initViews() { 67 | mRbHome = findViewById(R.id.rb_home); 68 | mRbPond = findViewById(R.id.rb_pond); 69 | mRbMsg = findViewById(R.id.rb_message); 70 | mRbPerson = findViewById(R.id.rb_me); 71 | mIvAdd = findViewById(R.id.rbAdd); 72 | mRbGroup = findViewById(R.id.radioGroup); 73 | mTVDes = findViewById(R.id.tvDes); 74 | 75 | Drawable dbHome = getResources().getDrawable(R.drawable.selector_home); 76 | dbHome.setBounds(0, 0, UIUtils.dipTopx(this,40), UIUtils.dipTopx(this,40)); 77 | mRbHome.setCompoundDrawables(null, dbHome, null, null); 78 | 79 | Drawable dbPond = getResources().getDrawable(R.drawable.selector_pond); 80 | dbPond.setBounds(0, 0, 40, 40); 81 | mRbPond.setCompoundDrawables(null, dbPond, null, null); 82 | 83 | Drawable dbMsg = getResources().getDrawable(R.drawable.selector_message); 84 | dbMsg.setBounds(0, 0, 40, 40); 85 | mRbMsg.setCompoundDrawables(null, dbMsg, null, null); 86 | 87 | Drawable dbMe = getResources().getDrawable(R.drawable.selector_person); 88 | dbMe.setBounds(0, 0, 40, 40); 89 | mRbPerson.setCompoundDrawables(null, dbMe, null, null); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/MyAttrsUtils.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.drawable.Drawable; 6 | import android.util.TypedValue; 7 | 8 | /** 9 | * @author crazyZhangxl on 2018/10/28. 10 | * Describe: 11 | */ 12 | public class MyAttrsUtils { 13 | /** 14 | * attrs PopupWindow down or up icon 15 | * 16 | * @param mContext 17 | * @param attr 18 | * @return 19 | */ 20 | public static Drawable getTypeValuePopWindowImg(Context mContext, int attr) { 21 | TypedValue typedValue = new TypedValue(); 22 | int[] attribute = new int[]{attr}; 23 | TypedArray array = mContext.obtainStyledAttributes(typedValue.resourceId, attribute); 24 | Drawable drawable = array.getDrawable(0); 25 | array.recycle(); 26 | return drawable; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/NoScrollViewPager.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.ViewPager; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | 8 | 9 | public class NoScrollViewPager extends ViewPager { 10 | 11 | public NoScrollViewPager(Context context) { 12 | this(context,null); 13 | } 14 | 15 | public NoScrollViewPager(Context context, AttributeSet attributes){ 16 | super(context,attributes); 17 | } 18 | 19 | 20 | 21 | @Override 22 | public boolean onInterceptTouchEvent(MotionEvent ev) { 23 | return false; 24 | } 25 | 26 | @Override 27 | public boolean onTouchEvent(MotionEvent ev) { 28 | return false; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/PopNiceActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.support.annotation.Nullable; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | import android.widget.RelativeLayout; 9 | import android.widget.TextView; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import butterknife.BindView; 15 | import butterknife.ButterKnife; 16 | import butterknife.Unbinder; 17 | 18 | /** 19 | * @author crazyZhangxl on 2018-10-28 19:27:48. 20 | * Describe: 21 | */ 22 | 23 | public class PopNiceActivity extends AppCompatActivity implements ListPopWindow.OnPopItemSelectedListener { 24 | 25 | @BindView(R.id.picture_left_back) 26 | ImageView mPictureLeftBack; 27 | @BindView(R.id.picture_title) 28 | TextView mPictureTitle; 29 | @BindView(R.id.picture_right) 30 | TextView mPictureRight; 31 | @BindView(R.id.rl_picture_title) 32 | RelativeLayout mRlPictureTitle; 33 | private List mList = new ArrayList<>(); 34 | private ListPopWindow mListPopWindow; 35 | private Unbinder mUnbinder; 36 | 37 | 38 | protected void init() { 39 | mList.add(new GalleryBean("第一条数据")); 40 | mList.add(new GalleryBean("第二条数据")); 41 | mList.add(new GalleryBean("第三条数据")); 42 | mList.add(new GalleryBean("第四条数据")); 43 | mList.add(new GalleryBean("第五条数据")); 44 | mList.add(new GalleryBean("第六条数据")); 45 | mList.add(new GalleryBean("第七条数据")); 46 | mList.add(new GalleryBean("第八条数据")); 47 | mList.add(new GalleryBean("第九条数据")); 48 | mList.add(new GalleryBean("第十条数据")); 49 | } 50 | 51 | 52 | 53 | @Override 54 | protected void onCreate(@Nullable Bundle savedInstanceState) { 55 | super.onCreate(savedInstanceState); 56 | setContentView(R.layout.activity_pop_nice); 57 | mUnbinder = ButterKnife.bind(this); 58 | init(); 59 | mListPopWindow = new ListPopWindow(this,mList); 60 | mListPopWindow.setPictureTitleView(mPictureTitle); 61 | mListPopWindow.setOnItemSelectedListener(this); 62 | 63 | mPictureTitle.setOnClickListener(new View.OnClickListener() { 64 | @Override 65 | public void onClick(View v) { 66 | if (mListPopWindow.isShowing()) { 67 | mListPopWindow.dismiss(); 68 | } else { 69 | mListPopWindow.showAsDropDown(mRlPictureTitle); 70 | } 71 | } 72 | }); 73 | } 74 | 75 | 76 | @Override 77 | public void popItemSelected(String title) { 78 | mPictureTitle.setText(title); 79 | mListPopWindow.dismiss(); 80 | } 81 | 82 | @Override 83 | protected void onDestroy() { 84 | super.onDestroy(); 85 | 86 | if (mUnbinder != null){ 87 | mUnbinder.unbind(); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/TopViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.FrameLayout; 7 | import android.widget.TextView; 8 | 9 | /** 10 | * @author crazyZhangxl on 2018-10-29 8:37:02. 11 | * Describe: 12 | */ 13 | 14 | public class TopViewActivity extends AppCompatActivity { 15 | private TextView mTvTitle; 16 | private FrameLayout mFragmentContent; 17 | private FilterDropDownDialog mFilterDropDownDialog; 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_top_view); 22 | initViews(); 23 | initListeners(); 24 | } 25 | 26 | private void initListeners() { 27 | mTvTitle.setOnClickListener(new View.OnClickListener() { 28 | @Override 29 | public void onClick(View v) { 30 | if (mFilterDropDownDialog != null && !mFilterDropDownDialog.isHasShow()){ 31 | mFilterDropDownDialog.show(); 32 | }else if (mFilterDropDownDialog != null && mFilterDropDownDialog.isHasShow()){ 33 | mFilterDropDownDialog.dismiss(); 34 | } 35 | } 36 | }); 37 | } 38 | 39 | private void initViews() { 40 | mTvTitle = findViewById(R.id.picture_title); 41 | mFragmentContent = findViewById(R.id.frameContent); 42 | if (mFilterDropDownDialog == null){ 43 | mFilterDropDownDialog = new FilterDropDownDialog(this,mFragmentContent,mTvTitle); 44 | } 45 | } 46 | 47 | @Override 48 | public void finish() { 49 | super.finish(); 50 | overridePendingTransition(0,0); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/UIUtils.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.graphics.drawable.Drawable; 6 | import android.util.DisplayMetrics; 7 | import android.widget.TextView; 8 | 9 | import java.lang.reflect.Field; 10 | 11 | /** 12 | * @author crazyZhangxl on 2018/10/28. 13 | * Describe: 14 | */ 15 | public class UIUtils { 16 | 17 | 18 | public static int getScreenWidth(Context context) { 19 | DisplayMetrics localDisplayMetrics = new DisplayMetrics(); 20 | ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics); 21 | return localDisplayMetrics.widthPixels; 22 | } 23 | public static int getScreenHeight(Context context) { 24 | DisplayMetrics localDisplayMetrics = new DisplayMetrics(); 25 | ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics); 26 | return localDisplayMetrics.heightPixels - getStatusBarHeight(context); 27 | } 28 | 29 | public static int getStatusBarHeight(Context context){ 30 | Class c = null; 31 | Object obj = null; 32 | Field field = null; 33 | int x = 0, statusBarHeight = 0; 34 | try { 35 | c = Class.forName("com.android.internal.R$dimen"); 36 | obj = c.newInstance(); 37 | field = c.getField("status_bar_height"); 38 | x = Integer.parseInt(field.get(obj).toString()); 39 | statusBarHeight = context.getResources().getDimensionPixelSize(x); 40 | } catch (Exception e1) { 41 | e1.printStackTrace(); 42 | } 43 | return statusBarHeight; 44 | } 45 | 46 | public static void modifyTextViewDrawable(TextView v, Drawable drawable, int index) { 47 | drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); 48 | //index 0:左 1:上 2:右 3:下 49 | if (index == 0) { 50 | v.setCompoundDrawables(drawable, null, null, null); 51 | } else if (index == 1) { 52 | v.setCompoundDrawables(null, drawable, null, null); 53 | } else if (index == 2) { 54 | v.setCompoundDrawables(null, null, drawable, null); 55 | } else { 56 | v.setCompoundDrawables(null, null, null, drawable); 57 | } 58 | } 59 | 60 | /** 61 | * dp转px 62 | * 63 | * @param context context 64 | * @param dpValue dp 65 | * @return px 66 | */ 67 | public static int dipTopx(Context context, float dpValue) { 68 | final float scale = context.getResources().getDisplayMetrics().density; 69 | return (int) (dpValue * scale + 0.5f); 70 | } 71 | 72 | /** 73 | * px转dp 74 | * 75 | * @param context context 76 | * @param pxValue px 77 | * @return dp 78 | */ 79 | public static float pxTodip(Context context, float pxValue) { 80 | final float scale = context.getResources().getDisplayMetrics().density; 81 | return pxValue / scale + 0.5f; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/delay/DelayDialogActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.delay; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | 9 | import com.example.windowshowdemo.R; 10 | 11 | /** 12 | * 弹出延迟2秒退出的dialog 13 | */ 14 | public class DelayDialogActivity extends AppCompatActivity { 15 | 16 | 17 | public static void show(Activity activity){ 18 | Intent intent = new Intent(activity,DelayDialogActivity.class); 19 | activity.startActivity(intent); 20 | } 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.activity_delay_dialog); 26 | 27 | findViewById(R.id.btnQuit).setOnClickListener(new View.OnClickListener() { 28 | @Override 29 | public void onClick(View v) { 30 | 31 | } 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/dialog/ContentDialog.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.dialog; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.os.Bundle; 6 | import android.support.annotation.NonNull; 7 | import android.view.Gravity; 8 | import android.view.Window; 9 | import android.view.WindowManager; 10 | 11 | import com.example.windowshowdemo.R; 12 | 13 | /** 14 | * Created by apple on 2019-09-10. 15 | * description: 内容dialog 16 | */ 17 | public class ContentDialog extends Dialog { 18 | public ContentDialog(@NonNull Context context) { 19 | super(context); 20 | } 21 | 22 | public ContentDialog(@NonNull Context context, int themeResId) { 23 | super(context, themeResId); 24 | } 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | setCancelable(true); 30 | setCanceledOnTouchOutside(true); 31 | setContentView(R.layout.dialog_content); 32 | Window window = getWindow(); 33 | if (window != null){ 34 | window.getDecorView().setPadding(0,0,0,0); 35 | WindowManager.LayoutParams lp = window.getAttributes(); 36 | lp.width = WindowManager.LayoutParams.MATCH_PARENT; 37 | lp.height = WindowManager.LayoutParams.WRAP_CONTENT; 38 | window.setAttributes(lp); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/dialog/DialogActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.dialog; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | 8 | import com.example.windowshowdemo.PopNiceActivity; 9 | import com.example.windowshowdemo.R; 10 | import com.example.windowshowdemo.like_alert.SimpleDialog; 11 | import com.example.windowshowdemo.like_alert.SimpleListener; 12 | import com.example.windowshowdemo.like_ios.TipDialog; 13 | 14 | public class DialogActivity extends AppCompatActivity { 15 | private TipDialog mQuitDialog; 16 | private SimpleDialog mSimpleDialog; 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_dialog); 21 | 22 | findViewById(R.id.btnSHow).setOnClickListener(new View.OnClickListener() { 23 | @Override 24 | public void onClick(View v) { 25 | new ContentDialog(DialogActivity.this,R.style.ShowDialog).show(); 26 | } 27 | }); 28 | 29 | findViewById(R.id.iosDialog).setOnClickListener(new View.OnClickListener() { 30 | @Override 31 | public void onClick(View v) { 32 | showQuitDialog(); 33 | } 34 | }); 35 | 36 | findViewById(R.id.btnAlert).setOnClickListener(new View.OnClickListener() { 37 | @Override 38 | public void onClick(View v) { 39 | showSimpleDialog(); 40 | } 41 | }); 42 | 43 | } 44 | 45 | private void showSimpleDialog(){ 46 | if (mSimpleDialog == null){ 47 | mSimpleDialog = new SimpleDialog.Builder(this) 48 | .setTitle("主题") 49 | .setContent("内容") 50 | .setSimpleListener(new SimpleListener() { 51 | @Override 52 | public void onChangeListener() { 53 | mSimpleDialog.setContent("我是内容2"); 54 | } 55 | }) 56 | .build(); 57 | } 58 | mSimpleDialog.show(); 59 | } 60 | 61 | private void showQuitDialog(){ 62 | if (mQuitDialog == null){ 63 | mQuitDialog = new TipDialog.Builder(this) 64 | .setMessage("合同暂未提交,确定退出?") 65 | .setCanCancelOutside(true) 66 | .setEnsureClickListener(new TipDialog.EnsureClickListener() { 67 | @Override 68 | public void onEnsureClick(TipDialog tipDialog) { 69 | tipDialog.dismiss(); 70 | } 71 | }).build(); 72 | } 73 | mQuitDialog.show(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/dialogfragment/BaseDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.dialogfragment; 2 | 3 | import android.app.Dialog; 4 | import android.os.Bundle; 5 | import android.support.annotation.LayoutRes; 6 | import android.support.annotation.Nullable; 7 | import android.support.v4.app.DialogFragment; 8 | import android.support.v4.app.FragmentManager; 9 | import android.util.DisplayMetrics; 10 | import android.util.Log; 11 | import android.view.Gravity; 12 | import android.view.LayoutInflater; 13 | import android.view.View; 14 | import android.view.ViewGroup; 15 | import android.view.Window; 16 | import android.view.WindowManager; 17 | 18 | import com.example.windowshowdemo.R; 19 | 20 | /** 21 | * Created by apple on 2019-09-03. 22 | * description:基础的dialogFragment 抽象类 23 | * 参考文章: 24 | * dialogFragment内存泄漏问题:https://www.jianshu.com/p/f2d6e6bc4b77 25 | * android版本更新项目: https://github.com/WVector/AppUpdate 26 | */ 27 | public abstract class BaseDialogFragment extends DialogFragment { 28 | 29 | private Local local = Local.BOTTOM; 30 | private Dialog dialog; 31 | private static final float DEFAULT_DIM = 0.6f; 32 | private static final String TAG = "base_dialog"; 33 | 34 | /** 35 | * 设置方向 36 | * 注意 该方法应该在 onCreate() super方法前调用 37 | * @param local 38 | */ 39 | public void setLocal(Local local) { 40 | this.local = local; 41 | } 42 | 43 | @Override 44 | public void onCreate(Bundle savedInstanceState) { 45 | super.onCreate(savedInstanceState); 46 | if (local == Local.BOTTOM){ 47 | setStyle(DialogFragment.STYLE_NO_TITLE, R.style.BottomDialog); 48 | }else { 49 | setStyle(DialogFragment.STYLE_NO_TITLE,R.style.CenterDialog); 50 | } 51 | } 52 | 53 | @Nullable 54 | @Override 55 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { 56 | dialog = getDialog(); 57 | if(dialog!=null){ 58 | if(dialog.getWindow()!=null){ 59 | dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); 60 | } 61 | dialog.setCanceledOnTouchOutside(isCancel()); 62 | dialog.setCancelable(isCancel()); 63 | } 64 | View v = inflater.inflate(getLayoutRes(), container, false); 65 | bindView(v); 66 | return v; 67 | } 68 | 69 | /** 70 | * 设置是否可以cancel 71 | * @return 72 | */ 73 | protected abstract boolean isCancel(); 74 | 75 | /** 76 | * 获取布局资源文件 77 | * @return 布局资源文件id值 78 | */ 79 | @LayoutRes 80 | public abstract int getLayoutRes(); 81 | 82 | /** 83 | * 绑定 84 | * @param v view 85 | */ 86 | public abstract void bindView(View v); 87 | 88 | /** 89 | * 开始展示 90 | */ 91 | @Override 92 | public void onStart() { 93 | super.onStart(); 94 | if(dialog==null){ 95 | dialog = getDialog(); 96 | } 97 | Window window = dialog.getWindow(); 98 | if(window!=null){ 99 | WindowManager.LayoutParams params = window.getAttributes(); 100 | // 半透明背景的灰度 101 | params.dimAmount = getDimAmount(); 102 | params.width = WindowManager.LayoutParams.MATCH_PARENT; 103 | if (getHeight() > 0) { 104 | params.height = getHeight(); 105 | } else { 106 | DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics(); 107 | params.height = (int) (displayMetrics.heightPixels * getPercent()); 108 | } 109 | if (local == Local.BOTTOM){ 110 | params.gravity = Gravity.BOTTOM; 111 | }else { 112 | params.gravity = Gravity.CENTER; 113 | } 114 | window.setAttributes(params); 115 | } 116 | } 117 | 118 | /** 119 | * 设置相对高度 120 | * 子类重写即可 121 | * @return 122 | */ 123 | public double getPercent(){ 124 | return 0.8f; 125 | } 126 | 127 | @Override 128 | public void onDestroy() { 129 | super.onDestroy(); 130 | dismissDialog(); 131 | } 132 | 133 | 134 | public int getHeight() { 135 | return -1; 136 | } 137 | 138 | public float getDimAmount() { 139 | return DEFAULT_DIM; 140 | } 141 | 142 | public void show(FragmentManager fragmentManager) { 143 | if(fragmentManager!=null){ 144 | show(fragmentManager,getFragmentTag()); 145 | }else { 146 | Log.e("show","需要设置setFragmentManager"); 147 | } 148 | } 149 | 150 | public String getFragmentTag() { 151 | return TAG; 152 | } 153 | 154 | 155 | public void dismissDialog(){ 156 | if(dialog!=null && dialog.isShowing()){ 157 | dialog.dismiss(); 158 | dialog = null; 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/dialogfragment/Local.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.dialogfragment; 2 | 3 | /** 4 | * Created by apple on 2019-09-03. 5 | * description: 弹窗的方位 6 | */ 7 | public enum Local { 8 | CENTER,BOTTOM,TOP 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/dialogfragment/UpdateFragment.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.dialogfragment; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.support.v4.app.FragmentActivity; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | 9 | import com.example.windowshowdemo.R; 10 | 11 | /** 12 | * Created by apple on 2019-09-03. 13 | * description:版本升级的Fragment 14 | * 15 | */ 16 | public class UpdateFragment extends BaseDialogFragment { 17 | private ImageView mIvClose; 18 | 19 | @Override 20 | protected boolean isCancel() { 21 | return false; 22 | } 23 | 24 | @Override 25 | public void onCreate(Bundle savedInstanceState) { 26 | setLocal(Local.BOTTOM); 27 | super.onCreate(savedInstanceState); 28 | } 29 | 30 | public static void showFragment(FragmentActivity activity){ 31 | UpdateFragment updateFragment = new UpdateFragment(); 32 | updateFragment.show(activity.getSupportFragmentManager()); 33 | } 34 | 35 | @Override 36 | public int getLayoutRes() { 37 | return R.layout.lib_update_app_dialog; 38 | } 39 | 40 | @Override 41 | public void bindView(View v) { 42 | mIvClose = v.findViewById(R.id.iv_close); 43 | mIvClose.setOnClickListener(new View.OnClickListener() { 44 | @Override 45 | public void onClick(View v) { 46 | // 关闭 47 | dismissDialog(); 48 | } 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/like_alert/SimpleController.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.like_alert; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.text.TextUtils; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.Window; 9 | import android.view.WindowManager; 10 | import android.widget.TextView; 11 | 12 | import com.example.windowshowdemo.R; 13 | 14 | /** 15 | * Created by apple on 2019-09-29. 16 | * description: 17 | */ 18 | public class SimpleController { 19 | private Context mContext; 20 | private TextView tvTitle,tvContent,tvChange; 21 | private SimpleListener mSimpleListener; 22 | private String mTitle,mContent; 23 | 24 | /** 25 | * 进行属性的设置 26 | * @param title 27 | */ 28 | public void setTitle(String title){ 29 | mTitle = title; 30 | if (tvTitle != null){ 31 | tvTitle.setText(title); 32 | } 33 | } 34 | 35 | public void setContent(String content){ 36 | mContent = content; 37 | if (tvContent != null){ 38 | tvContent.setText(content); 39 | } 40 | } 41 | 42 | public void setSimpleListener(SimpleListener simpleListener){ 43 | this.mSimpleListener = simpleListener; 44 | } 45 | 46 | public SimpleController(Context context) { 47 | mContext = context; 48 | } 49 | 50 | /** 51 | * 初始化view 52 | * @param dialog 53 | */ 54 | public void installContent(Dialog dialog){ 55 | View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_simple, null, false); 56 | tvContent = view.findViewById(R.id.tvContent); 57 | tvTitle = view.findViewById(R.id.tvTitle); 58 | tvChange = view.findViewById(R.id.tvChange); 59 | Window window = dialog.getWindow(); 60 | if (window != null){ 61 | WindowManager.LayoutParams attributes = window.getAttributes(); 62 | attributes.width = WindowManager.LayoutParams.MATCH_PARENT; 63 | attributes.height = WindowManager.LayoutParams.WRAP_CONTENT; 64 | window.setAttributes(attributes); 65 | } 66 | setupViews(); 67 | initListener(); 68 | dialog.setContentView(view); 69 | } 70 | 71 | private void setupViews() { 72 | if (!TextUtils.isEmpty(mTitle)){ 73 | tvTitle.setText(mTitle); 74 | } 75 | 76 | if (!TextUtils.isEmpty(mContent)){ 77 | tvContent.setText(mContent); 78 | } 79 | } 80 | 81 | private void initListener() { 82 | tvChange.setOnClickListener(new View.OnClickListener() { 83 | @Override 84 | public void onClick(View v) { 85 | if (mSimpleListener != null){ 86 | mSimpleListener.onChangeListener(); 87 | } 88 | } 89 | }); 90 | } 91 | 92 | /** 93 | * 参数信息 94 | */ 95 | public static class SimpleParams{ 96 | public String title; 97 | public String content; 98 | public final Context mContext; 99 | public SimpleListener mSimpleListener; 100 | public SimpleParams(Context context){ 101 | this.mContext = context; 102 | } 103 | 104 | public void apply(SimpleController controller){ 105 | if (title != null){ 106 | controller.setTitle(title); 107 | } 108 | 109 | if (content != null){ 110 | controller.setContent(content); 111 | } 112 | 113 | controller.setSimpleListener(mSimpleListener); 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/like_alert/SimpleDialog.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.like_alert; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.os.Bundle; 6 | import android.support.annotation.NonNull; 7 | 8 | import com.example.windowshowdemo.R; 9 | 10 | /** 11 | * Created by apple on 2019-09-29. 12 | * description: 简单的dialog 13 | */ 14 | public class SimpleDialog extends Dialog { 15 | private SimpleController mSimpleController; 16 | 17 | public SimpleDialog(@NonNull Context context) { 18 | this(context,0); 19 | } 20 | 21 | public SimpleDialog(@NonNull Context context, int themeResId) { 22 | super(context, themeResId); 23 | mSimpleController = new SimpleController(context); 24 | } 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | mSimpleController.installContent(this); 30 | } 31 | 32 | 33 | public void setContent(String content){ 34 | mSimpleController.setTitle(content); 35 | } 36 | 37 | /** 38 | * 参数构建的内部类 39 | */ 40 | public static class Builder{ 41 | private SimpleController.SimpleParams mParams; 42 | public Builder(Context context){ 43 | mParams = new SimpleController.SimpleParams(context); 44 | } 45 | 46 | public Builder setTitle(String title){ 47 | mParams.title = title; 48 | return this; 49 | } 50 | 51 | public Builder setContent(String content){ 52 | mParams.content = content; 53 | return this; 54 | } 55 | 56 | public Builder setSimpleListener(SimpleListener simpleListener){ 57 | mParams.mSimpleListener = simpleListener; 58 | return this; 59 | } 60 | 61 | public SimpleDialog build(){ 62 | SimpleDialog simpleDialog = new SimpleDialog(mParams.mContext, R.style.MyDialog); 63 | mParams.apply(simpleDialog.mSimpleController); 64 | return simpleDialog; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/like_alert/SimpleListener.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.like_alert; 2 | 3 | /** 4 | * Created by apple on 2019-09-29. 5 | * description: 6 | */ 7 | public interface SimpleListener { 8 | void onChangeListener(); 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/like_alert/说明.txt: -------------------------------------------------------------------------------- 1 | 模仿AlertDialog自定义dialog实现点击文字修改数据 -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/like_ios/TipDialog.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.like_ios; 2 | 3 | import android.app.AlertDialog; 4 | import android.app.Dialog; 5 | import android.content.Context; 6 | import android.os.Build; 7 | import android.support.annotation.NonNull; 8 | import android.text.TextUtils; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.widget.TextView; 12 | 13 | import com.example.windowshowdemo.R; 14 | 15 | /** 16 | * Created by apple on 2019-09-29. 17 | * description:仿ios弹出确认框 18 | */ 19 | public class TipDialog extends Dialog { 20 | public TipDialog(@NonNull Context context) { 21 | this(context,0); 22 | } 23 | 24 | 25 | public TipDialog(@NonNull Context context, int themeResId) { 26 | super(context, themeResId); 27 | } 28 | 29 | public interface CancelClickListener{ 30 | void onCancelClick(TipDialog tipDialog); 31 | } 32 | 33 | public interface EnsureClickListener{ 34 | void onEnsureClick(TipDialog tipDialog); 35 | } 36 | 37 | public static class Builder{ 38 | // 默认可点击退出 39 | private boolean closeOnTouchOutside = true; 40 | private Context context; 41 | private String title,message; 42 | private String cancelString = "取消"; 43 | private String ensureString = "确定"; 44 | private CancelClickListener mCancelClickListener; 45 | private EnsureClickListener mEnsureClickListener; 46 | 47 | public Builder(Context context) { 48 | this.context = context; 49 | } 50 | 51 | public Builder setTitle(String title){ 52 | this.title = title; 53 | return this; 54 | } 55 | 56 | public Builder setMessage(String message){ 57 | this.message = message; 58 | return this; 59 | } 60 | 61 | public Builder setCancelText(String cancelString){ 62 | this.cancelString = cancelString; 63 | return this; 64 | } 65 | 66 | public Builder setEnsureText(String ensureString){ 67 | this.ensureString = ensureString; 68 | return this; 69 | } 70 | 71 | public Builder setCancelCickListener(CancelClickListener cancelCickListener){ 72 | this.mCancelClickListener = cancelCickListener; 73 | return this; 74 | } 75 | 76 | public Builder setEnsureClickListener(EnsureClickListener ensureClickListener){ 77 | this.mEnsureClickListener = ensureClickListener; 78 | return this; 79 | } 80 | 81 | public Builder setCanCancelOutside(boolean canCancelOutside){ 82 | this.closeOnTouchOutside = canCancelOutside; 83 | return this; 84 | } 85 | 86 | /** 87 | * 进行对象的构建 88 | * @return 89 | */ 90 | public TipDialog build(){ 91 | final TipDialog tipDialog = new TipDialog(context,R.style.MyDialog); 92 | View localView = LayoutInflater.from(context).inflate(R.layout.dialog_tip,null); 93 | TextView tvTitle = localView.findViewById(R.id.tvTitle); 94 | TextView tvContent = localView.findViewById(R.id.tvContent); 95 | TextView tvCancel = localView.findViewById(R.id.btnCancel); 96 | TextView tvEnsure = localView.findViewById(R.id.btnEnsure); 97 | 98 | if (TextUtils.isEmpty(title)){ 99 | tvTitle.setVisibility(View.GONE); 100 | }else { 101 | tvTitle.setVisibility(View.VISIBLE); 102 | tvTitle.setText(title); 103 | } 104 | if (TextUtils.isEmpty(message)){ 105 | tvContent.setVisibility(View.GONE); 106 | }else { 107 | tvContent.setVisibility(View.VISIBLE); 108 | tvContent.setText(message); 109 | } 110 | tvCancel.setText(cancelString); 111 | tvEnsure.setText(ensureString); 112 | 113 | // 取消事件 114 | tvCancel.setOnClickListener(new View.OnClickListener() { 115 | @Override 116 | public void onClick(View v) { 117 | if (mCancelClickListener != null){ 118 | mCancelClickListener.onCancelClick(tipDialog); 119 | }else { 120 | tipDialog.dismiss(); 121 | } 122 | } 123 | }); 124 | // 确定事件 125 | tvEnsure.setOnClickListener(new View.OnClickListener() { 126 | @Override 127 | public void onClick(View v) { 128 | if (mEnsureClickListener != null){ 129 | mEnsureClickListener.onEnsureClick(tipDialog); 130 | }else { 131 | tipDialog.dismiss(); 132 | } 133 | } 134 | }); 135 | tipDialog.setCanceledOnTouchOutside(closeOnTouchOutside); 136 | tipDialog.setContentView(localView); 137 | return tipDialog; 138 | } 139 | } 140 | } 141 | 142 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/like_qianchen/FilterHeadView.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.like_qianchen; 2 | 3 | import android.animation.Animator; 4 | import android.animation.AnimatorListenerAdapter; 5 | import android.animation.ObjectAnimator; 6 | import android.content.Context; 7 | import android.support.annotation.NonNull; 8 | import android.support.annotation.Nullable; 9 | import android.util.AttributeSet; 10 | import android.view.LayoutInflater; 11 | import android.view.View; 12 | import android.view.ViewTreeObserver; 13 | import android.widget.FrameLayout; 14 | import android.widget.LinearLayout; 15 | import android.widget.RelativeLayout; 16 | 17 | import com.example.windowshowdemo.R; 18 | 19 | /** 20 | * Created by apple on 2019-09-30. 21 | * description: 22 | */ 23 | public class FilterHeadView extends LinearLayout { 24 | 25 | private Context mContext; 26 | private LinearLayout mHeadView; 27 | // frame内容布局 28 | private FrameLayout mFlContent; 29 | private View mViewMask; 30 | private RelativeLayout rlContent; 31 | private int mContentHeight; 32 | private boolean isHasShow = false; 33 | 34 | public FilterHeadView(@NonNull Context context) { 35 | this(context,null); 36 | } 37 | 38 | public FilterHeadView(@NonNull Context context, @Nullable AttributeSet attrs) { 39 | this(context, attrs,0); 40 | } 41 | 42 | public FilterHeadView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 43 | super(context, attrs, defStyleAttr); 44 | this.mContext = context; 45 | init(); 46 | initViews(); 47 | 48 | } 49 | 50 | private void initViews() { 51 | mFlContent.setVisibility(GONE); 52 | } 53 | 54 | /** 55 | * 进行初始化的操作 56 | */ 57 | private void init() { 58 | View rootView = LayoutInflater.from(mContext).inflate(R.layout.layout_filter_view,this); 59 | mHeadView = rootView.findViewById(R.id.llHead); 60 | mFlContent = rootView.findViewById(R.id.flContent); 61 | mViewMask = rootView.findViewById(R.id.view_mask_bg); 62 | rlContent = rootView.findViewById(R.id.rlContent); 63 | initListener(); 64 | } 65 | 66 | private void initListener(){ 67 | // 头部head的点击事件... 68 | mHeadView.setOnClickListener(new View.OnClickListener() { 69 | @Override 70 | public void onClick(View v) { 71 | show(); 72 | } 73 | }); 74 | 75 | mViewMask.setOnClickListener(new View.OnClickListener() { 76 | @Override 77 | public void onClick(View v) { 78 | hide(); 79 | } 80 | }); 81 | } 82 | 83 | 84 | 85 | private void show(){ 86 | if (isHasShow){ 87 | return; 88 | } 89 | isHasShow = true; 90 | mFlContent.setVisibility(VISIBLE); 91 | if (mContentHeight == 0){ 92 | // 设置动画 93 | rlContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { 94 | @Override 95 | public void onGlobalLayout() { 96 | mContentHeight = rlContent.getMeasuredHeight(); 97 | rlContent.getViewTreeObserver().removeOnGlobalLayoutListener(this); 98 | // 测量需要一定时间 99 | // 从顶部进入界面 100 | ObjectAnimator outIn = ObjectAnimator.ofFloat(rlContent, "translationY", -mContentHeight, 0); 101 | outIn.setDuration(400); 102 | outIn.start(); 103 | } 104 | }); 105 | }else { 106 | ObjectAnimator outIn = ObjectAnimator.ofFloat(rlContent, "translationY", -mContentHeight, 0); 107 | outIn.setDuration(400); 108 | outIn.start(); 109 | } 110 | 111 | } 112 | 113 | private void hide(){ 114 | ObjectAnimator outOut = ObjectAnimator.ofFloat(rlContent, "translationY", 0, -mContentHeight); 115 | outOut.setDuration(400); 116 | outOut.addListener(new AnimatorListenerAdapter() { 117 | @Override 118 | public void onAnimationEnd(Animator animation) { 119 | super.onAnimationEnd(animation); 120 | mFlContent.setVisibility(GONE); 121 | isHasShow = false; 122 | } 123 | }); 124 | outOut.start(); 125 | } 126 | 127 | 128 | } 129 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/like_qianchen/QianchengFilterActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.like_qianchen; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | import com.example.windowshowdemo.R; 7 | 8 | /** 9 | * 模仿前程筛选列表的遮层效果... 10 | */ 11 | public class QianchengFilterActivity extends AppCompatActivity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_qiancheng_filter); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/loading/PaintDrawable.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.loading; 2 | 3 | import android.graphics.ColorFilter; 4 | import android.graphics.Paint; 5 | import android.graphics.PixelFormat; 6 | import android.graphics.drawable.Drawable; 7 | 8 | /** 9 | * 画笔 Drawable 10 | * Created by SCWANG on 2017/6/16. 11 | */ 12 | public abstract class PaintDrawable extends Drawable { 13 | 14 | protected Paint mPaint = new Paint(); 15 | 16 | protected PaintDrawable() { 17 | mPaint.setStyle(Paint.Style.FILL); 18 | mPaint.setAntiAlias(true); 19 | mPaint.setColor(0xffaaaaaa); 20 | } 21 | 22 | public void setColor(int color) { 23 | mPaint.setColor(color); 24 | } 25 | 26 | @Override 27 | public void setAlpha(int alpha) { 28 | mPaint.setAlpha(alpha); 29 | } 30 | 31 | @Override 32 | public void setColorFilter(ColorFilter cf) { 33 | mPaint.setColorFilter(cf); 34 | } 35 | 36 | @Override 37 | public int getOpacity() { 38 | return PixelFormat.TRANSLUCENT; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/loading/ProgressDrawable.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.loading; 2 | 3 | import android.animation.Animator; 4 | import android.animation.ValueAnimator; 5 | import android.graphics.Canvas; 6 | import android.graphics.Path; 7 | import android.graphics.Rect; 8 | import android.graphics.drawable.Animatable; 9 | import android.graphics.drawable.Drawable; 10 | import android.support.annotation.NonNull; 11 | 12 | /** 13 | * 旋转动画 14 | * Created by SCWANG on 2017/6/16. 15 | */ 16 | @SuppressWarnings("WeakerAccess") 17 | public class ProgressDrawable extends PaintDrawable implements Animatable, ValueAnimator.AnimatorUpdateListener{ 18 | 19 | protected int mWidth = 0; 20 | protected int mHeight = 0; 21 | protected int mProgressDegree = 0; 22 | protected ValueAnimator mValueAnimator; 23 | protected Path mPath = new Path(); 24 | 25 | public ProgressDrawable() { 26 | mValueAnimator = ValueAnimator.ofInt(30, 3600); 27 | mValueAnimator.setDuration(10000); 28 | mValueAnimator.setInterpolator(null); 29 | mValueAnimator.setRepeatCount(ValueAnimator.INFINITE); 30 | mValueAnimator.setRepeatMode(ValueAnimator.RESTART); 31 | } 32 | 33 | @Override 34 | public void onAnimationUpdate(ValueAnimator animation) { 35 | int value = (int) animation.getAnimatedValue(); 36 | mProgressDegree = 30 * (value / 30); 37 | final Drawable drawable = ProgressDrawable.this; 38 | drawable.invalidateSelf(); 39 | } 40 | 41 | // 42 | @Override 43 | public void draw(@NonNull Canvas canvas) { 44 | final Drawable drawable = ProgressDrawable.this; 45 | final Rect bounds = drawable.getBounds(); 46 | final int width = bounds.width(); 47 | final int height = bounds.height(); 48 | final float r = Math.max(1f, width / 22f); 49 | 50 | if (mWidth != width || mHeight != height) { 51 | mPath.reset(); 52 | mPath.addCircle(width - r, height / 2f, r, Path.Direction.CW); 53 | mPath.addRect(width - 5 * r, height / 2f - r, width - r, height / 2f + r, Path.Direction.CW); 54 | mPath.addCircle(width - 5 * r, height / 2f, r, Path.Direction.CW); 55 | mWidth = width; 56 | mHeight = height; 57 | } 58 | 59 | canvas.save(); 60 | canvas.rotate(mProgressDegree, (width) / 2f, (height) / 2f); 61 | for (int i = 0; i < 12; i++) { 62 | mPaint.setAlpha((i+5) * 0x11); 63 | canvas.rotate(30, (width) / 2f, (height) / 2f); 64 | canvas.drawPath(mPath, mPaint); 65 | } 66 | canvas.restore(); 67 | } 68 | 69 | // 70 | 71 | @Override 72 | public void start() { 73 | if (!mValueAnimator.isRunning()) { 74 | mValueAnimator.addUpdateListener(this); 75 | mValueAnimator.start(); 76 | } 77 | } 78 | 79 | @Override 80 | public void stop() { 81 | if (mValueAnimator.isRunning()) { 82 | Animator animator = mValueAnimator; 83 | animator.removeAllListeners(); 84 | mValueAnimator.removeAllUpdateListeners(); 85 | mValueAnimator.cancel(); 86 | } 87 | } 88 | 89 | @Override 90 | public boolean isRunning() { 91 | return mValueAnimator.isRunning(); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/loading/StaticLoadActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.loading; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.graphics.drawable.Animatable; 6 | import android.graphics.drawable.AnimationDrawable; 7 | import android.support.v7.app.AppCompatActivity; 8 | import android.os.Bundle; 9 | import android.view.View; 10 | import android.widget.Button; 11 | import android.widget.ImageView; 12 | import android.widget.ProgressBar; 13 | import android.widget.Toast; 14 | 15 | import com.example.windowshowdemo.R; 16 | import com.example.windowshowdemo.toast.MyToast; 17 | 18 | /** 19 | * 静态进度条活动... 20 | */ 21 | public class StaticLoadActivity extends AppCompatActivity { 22 | 23 | private ProgressBar mProgressBar; 24 | private Button mBtnProgressBar; 25 | private ImageView ivProgress; 26 | private ProgressDrawable mProgressDrawable; 27 | public static void show(Activity activity){ 28 | Intent intent = new Intent(activity,StaticLoadActivity.class); 29 | activity.startActivity(intent); 30 | } 31 | 32 | @Override 33 | protected void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | setContentView(R.layout.activity_static_load); 36 | initViews(); 37 | initListener(); 38 | } 39 | 40 | private void initListener() { 41 | mBtnProgressBar.setOnClickListener(new View.OnClickListener() { 42 | @Override 43 | public void onClick(View v) { 44 | if (mProgressBar.getVisibility() == View.VISIBLE){ 45 | mProgressBar.setVisibility(View.GONE); 46 | }else { 47 | mProgressBar.setVisibility(View.VISIBLE); 48 | } 49 | } 50 | }); 51 | 52 | findViewById(R.id.btnNative).setOnClickListener(new View.OnClickListener() { 53 | @Override 54 | public void onClick(View v) { 55 | Toast.makeText(StaticLoadActivity.this, "发送成功", Toast.LENGTH_SHORT).show(); 56 | } 57 | }); 58 | 59 | findViewById(R.id.btnCustom).setOnClickListener(new View.OnClickListener() { 60 | @Override 61 | public void onClick(View v) { 62 | MyToast.showText(StaticLoadActivity.this,"发送成功").show(); 63 | 64 | } 65 | }); 66 | } 67 | 68 | private void initViews() { 69 | mProgressBar = findViewById(R.id.progressbar); 70 | mBtnProgressBar = findViewById(R.id.btnProgressBar); 71 | ivProgress = findViewById(R.id.ivProgress); 72 | 73 | mProgressDrawable = new ProgressDrawable(); 74 | mProgressDrawable.setColor(0xff666666); 75 | ivProgress.setImageDrawable(mProgressDrawable); 76 | ((Animatable)(ivProgress.getDrawable())).start(); 77 | } 78 | 79 | @Override 80 | protected void onDestroy() { 81 | super.onDestroy(); 82 | ((Animatable)(ivProgress.getDrawable())).start(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/model/EnjoyBean.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.model; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by apple on 2019-09-03. 7 | * description: 喜欢的数据bean 8 | */ 9 | public class EnjoyBean implements Serializable { 10 | private int id; 11 | private String description; 12 | private boolean isSelected; 13 | 14 | public int getId() { 15 | return id; 16 | } 17 | 18 | public void setId(int id) { 19 | this.id = id; 20 | } 21 | 22 | public String getDescription() { 23 | return description; 24 | } 25 | 26 | public void setDescription(String description) { 27 | this.description = description; 28 | } 29 | 30 | public boolean isSelected() { 31 | return isSelected; 32 | } 33 | 34 | public void setSelected(boolean selected) { 35 | isSelected = selected; 36 | } 37 | 38 | public EnjoyBean(int id, String description) { 39 | this.id = id; 40 | this.description = description; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/popup/LargePopupWindow.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.popup; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.graphics.Color; 6 | import android.graphics.Rect; 7 | import android.graphics.drawable.ColorDrawable; 8 | import android.os.Build; 9 | import android.os.Handler; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.view.animation.Animation; 13 | import android.view.animation.AnimationUtils; 14 | import android.widget.PopupWindow; 15 | 16 | import com.example.windowshowdemo.DisplayHelper; 17 | import com.example.windowshowdemo.R; 18 | 19 | /** 20 | * Created by apple on 2019-09-11. 21 | * description:适配全面屏解决版本过高,popupWindow的位置不在控件下方的问题 22 | * 23 | * 注意是可以设置pop窗体样式的,当然这是我们不设置其整体背景的情况下,也就是背景透明时; 24 | * 而当背景灰度再设置其动画,致使其灰度窗体效果不佳 25 | * 26 | * (任意位置弹窗效果) 27 | */ 28 | public class LargePopupWindow extends PopupWindow { 29 | private View mRootView; 30 | private Context context; 31 | private Animation animationIn, animationOut; 32 | private boolean isDismiss = false; 33 | 34 | public LargePopupWindow(Context context, View view) { 35 | // 设置宽高 36 | super(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); 37 | //设置有焦点 38 | setContentView(view); 39 | setFocusable(true); 40 | //设置点击外部可消失 41 | setOutsideTouchable(true); 42 | // 设置窗口样式 43 | // 整体窗体样式附属了遮层,需要考虑设置.. 44 | // this.setAnimationStyle(R.style.WindowStyle); 45 | setBackgroundDrawable(new ColorDrawable(Color.argb(123, 0, 0, 0))); 46 | update(); 47 | this.context = context; 48 | this.mRootView = view; 49 | initViews(); 50 | } 51 | 52 | private void initViews() { 53 | animationIn = AnimationUtils.loadAnimation(context, R.anim.photo_album_show); 54 | animationOut = AnimationUtils.loadAnimation(context, R.anim.photo_album_dismiss); 55 | mRootView.setOnClickListener(new View.OnClickListener() { 56 | @Override 57 | public void onClick(View v) { 58 | dismiss(); 59 | } 60 | }); 61 | } 62 | 63 | @Override 64 | public void showAsDropDown(View anchor) { 65 | if(Build.VERSION.SDK_INT >= 24) { 66 | Rect rect = new Rect(); 67 | anchor.getGlobalVisibleRect(rect); 68 | // 适配全面屏.... 69 | // 解决全面屏手机使用顶部弹窗带来的问题 70 | if (DisplayHelper.isNavigationBarExist((Activity) context)){ 71 | int h = anchor.getResources().getDisplayMetrics().heightPixels - rect.bottom; 72 | setHeight(h); 73 | }else { 74 | //全面屏手机需要获取真实高度.... 75 | int h = DisplayHelper.getRealScreenSize(context)[1] - rect.bottom; 76 | setHeight(h); 77 | } 78 | } 79 | super.showAsDropDown(anchor); 80 | mRootView.startAnimation(animationIn); 81 | } 82 | 83 | @Override 84 | public void dismiss() { 85 | if (isDismiss){ 86 | return; 87 | } 88 | isDismiss = true; 89 | mRootView.startAnimation(animationOut); 90 | animationOut.setAnimationListener(new Animation.AnimationListener() { 91 | @Override 92 | public void onAnimationStart(Animation animation) { 93 | 94 | } 95 | 96 | @Override 97 | public void onAnimationEnd(Animation animation) { 98 | isDismiss = false; 99 | if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) { 100 | dismiss4Pop(); 101 | } else { 102 | LargePopupWindow.super.dismiss(); 103 | } 104 | } 105 | 106 | @Override 107 | public void onAnimationRepeat(Animation animation) { 108 | 109 | } 110 | }); 111 | } 112 | 113 | /** 114 | * 在android4.1.1和4.1.2版本关闭PopWindow 115 | */ 116 | private void dismiss4Pop() { 117 | new Handler().post(new Runnable() { 118 | @Override 119 | public void run() { 120 | LargePopupWindow.super.dismiss(); 121 | } 122 | }); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/popup/PopupWindowActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.popup; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.widget.Button; 8 | import android.widget.PopupWindow; 9 | 10 | import com.example.windowshowdemo.R; 11 | 12 | /** 13 | * popupwindow 弹窗窗学习... 14 | */ 15 | public class PopupWindowActivity extends AppCompatActivity { 16 | private View headView; 17 | private Button mBtnFirst; 18 | private PopupWindow mPopupWindow; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_popup_window); 24 | initViews(); 25 | initListener(); 26 | } 27 | 28 | private void initListener() { 29 | headView.setOnClickListener(new View.OnClickListener() { 30 | @Override 31 | public void onClick(View v) { 32 | if (mPopupWindow.isShowing()){ 33 | mPopupWindow.dismiss(); 34 | }else { 35 | mPopupWindow.showAsDropDown(headView); 36 | } 37 | } 38 | }); 39 | } 40 | 41 | private void initViews() { 42 | headView = findViewById(R.id.head); 43 | initPopHead(); 44 | } 45 | 46 | // 将pop置于头部下 47 | private void initPopHead(){ 48 | View view = LayoutInflater.from(this).inflate(R.layout.pop_below_head, null, false); 49 | mPopupWindow = new LargePopupWindow(this,view); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/toast/MyToast.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.toast; 2 | 3 | import android.content.Context; 4 | import android.graphics.Typeface; 5 | import android.graphics.drawable.Drawable; 6 | import android.support.annotation.NonNull; 7 | import android.util.TypedValue; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | import android.widget.Toast; 13 | 14 | import com.example.windowshowdemo.R; 15 | 16 | /** 17 | * Created by apple on 2019-09-05. 18 | * description: 19 | */ 20 | public class MyToast { 21 | public static final int LENGTH_SHORT = Toast.LENGTH_SHORT; 22 | public static final int LENGTH_LONG = Toast.LENGTH_LONG; 23 | 24 | public static Toast showText(@NonNull Context context, @NonNull CharSequence message){ 25 | return custom(context,message,LENGTH_SHORT); 26 | } 27 | 28 | public static Toast showText(@NonNull Context context, @NonNull CharSequence message,int duration){ 29 | return custom(context,message,duration); 30 | } 31 | 32 | 33 | public static Toast custom(@NonNull Context context, @NonNull CharSequence message,int duration){ 34 | final Toast currentToast = Toast.makeText(context, "", duration); 35 | final View toastLayout = ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)) 36 | .inflate(R.layout.toast_layout, null); 37 | final TextView toastTextView = toastLayout.findViewById(R.id.toast_text); 38 | toastTextView.setText(message); 39 | currentToast.setView(toastLayout); 40 | return currentToast; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/windowshowdemo/xianyu/PubActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.windowshowdemo.xianyu; 2 | 3 | import android.animation.Animator; 4 | import android.animation.AnimatorListenerAdapter; 5 | import android.animation.AnimatorSet; 6 | import android.animation.ObjectAnimator; 7 | import android.content.Context; 8 | import android.content.Intent; 9 | import android.graphics.Color; 10 | import android.os.Build; 11 | import android.support.annotation.Nullable; 12 | import android.support.v7.app.AppCompatActivity; 13 | import android.os.Bundle; 14 | import android.view.View; 15 | import android.view.Window; 16 | import android.view.WindowManager; 17 | import android.view.animation.DecelerateInterpolator; 18 | import android.widget.ImageView; 19 | import android.widget.LinearLayout; 20 | import android.widget.RelativeLayout; 21 | 22 | import com.example.windowshowdemo.R; 23 | import com.example.windowshowdemo.UIUtils; 24 | 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | public class PubActivity extends AppCompatActivity implements View.OnClickListener { 29 | private ImageView mBtnPub; 30 | private LinearLayout mLlArticle,mLlBlog, mLlTweet; 31 | private List mLays = new ArrayList(); 32 | private RelativeLayout mRlMain; 33 | @Override 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | setContentView(R.layout.activity_pub); 37 | initWindow(); 38 | initViews(); 39 | } 40 | 41 | protected void initWindow() { 42 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 43 | Window window = getWindow(); 44 | window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 45 | window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN 46 | | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); 47 | window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); 48 | window.setStatusBarColor(Color.TRANSPARENT); 49 | } 50 | getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT); 51 | } 52 | 53 | public static void show(Context context) { 54 | context.startActivity(new Intent(context, PubActivity.class)); 55 | } 56 | 57 | @Override 58 | public void onBackPressed() { 59 | dismiss(); 60 | } 61 | 62 | @Override 63 | public void finish() { 64 | super.finish(); 65 | overridePendingTransition(0,0); 66 | } 67 | 68 | private void initViews() { 69 | mBtnPub = findViewById(R.id.btn_pub); 70 | mLlArticle = findViewById(R.id.ll_pub_article); 71 | mLlBlog = findViewById(R.id.ll_pub_blog); 72 | mLlTweet = findViewById(R.id.ll_pub_tweet); 73 | mRlMain = findViewById(R.id.rl_main); 74 | mLays.add(mLlArticle); 75 | mLays.add(mLlBlog); 76 | mLays.add(mLlTweet); 77 | mLlArticle.setOnClickListener(this); 78 | mLlBlog.setOnClickListener(this); 79 | mLlTweet.setOnClickListener(this); 80 | mRlMain.setOnClickListener(this); 81 | } 82 | 83 | @Override 84 | protected void onPostCreate(@Nullable Bundle savedInstanceState) { 85 | super.onPostCreate(savedInstanceState); 86 | mBtnPub.animate() 87 | .rotation(135.0f) 88 | .setDuration(180) 89 | .setListener(new AnimatorListenerAdapter() { 90 | @Override 91 | public void onAnimationEnd(Animator animation) { 92 | super.onAnimationEnd(animation); 93 | } 94 | }) 95 | .start(); 96 | show(0); 97 | show(1); 98 | show(2); 99 | } 100 | 101 | private void show(int position) { 102 | int angle = 30 + position * 60; 103 | float x = (float) Math.cos(angle * (Math.PI / 180)) * UIUtils.dipTopx(this, 100); 104 | float y = (float) -Math.sin(angle * (Math.PI / 180)) * UIUtils.dipTopx(this, position != 1 ? 160 : 100); 105 | ObjectAnimator objectAnimatorX = ObjectAnimator.ofFloat(mLays.get(position), "translationX", 0, x); 106 | ObjectAnimator objectAnimatorY = ObjectAnimator.ofFloat(mLays.get(position), "translationY", 0, y); 107 | AnimatorSet animatorSet = new AnimatorSet(); 108 | animatorSet.setDuration(180); 109 | animatorSet.play(objectAnimatorX).with(objectAnimatorY); 110 | animatorSet.start(); 111 | } 112 | 113 | private void close() { 114 | mBtnPub.clearAnimation(); 115 | mBtnPub.animate() 116 | .rotation(0f) 117 | .setDuration(200) 118 | .setListener(new AnimatorListenerAdapter() { 119 | @Override 120 | public void onAnimationEnd(Animator animation) { 121 | super.onAnimationEnd(animation); 122 | mBtnPub.setVisibility(View.GONE); 123 | finish(); 124 | } 125 | }) 126 | .start(); 127 | } 128 | 129 | private void dismiss() { 130 | close(); 131 | close(0); 132 | close(1); 133 | close(2); 134 | } 135 | 136 | private void close(final int position) { 137 | int angle = 30 + position * 60; 138 | float x = (float) Math.cos(angle * (Math.PI / 180)) * UIUtils.dipTopx(this, 100); 139 | float y = (float) -Math.sin(angle * (Math.PI / 180)) * UIUtils.dipTopx(this, position != 1 ? 160 : 100); 140 | ObjectAnimator objectAnimatorX = ObjectAnimator.ofFloat(mLays.get(position), "translationX", x, 0); 141 | ObjectAnimator objectAnimatorY = ObjectAnimator.ofFloat(mLays.get(position), "translationY", y, 0); 142 | AnimatorSet animatorSet = new AnimatorSet(); 143 | animatorSet.setDuration(180); 144 | animatorSet.setInterpolator(new DecelerateInterpolator()); 145 | animatorSet.play(objectAnimatorX).with(objectAnimatorY); 146 | animatorSet.addListener(new AnimatorListenerAdapter() { 147 | @Override 148 | public void onAnimationEnd(Animator animation) { 149 | super.onAnimationEnd(animation); 150 | mLays.get(position).setVisibility(View.GONE); 151 | } 152 | }); 153 | animatorSet.start(); 154 | } 155 | 156 | @Override 157 | public void onClick(View v) { 158 | switch (v.getId()){ 159 | case R.id.ll_pub_article: 160 | break; 161 | case R.id.ll_pub_blog: 162 | break; 163 | case R.id.ll_pub_tweet: 164 | break; 165 | case R.id.rl_main: 166 | dismiss(); 167 | break; 168 | } 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /app/src/main/res/anim/dd_mask_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/dd_mask_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/dd_menu_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/dd_menu_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/push_bottom_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/push_bottom_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/push_top_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/anim/push_top_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_from_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_to_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/color/navigator_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/comui_tab_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable-xxhdpi/comui_tab_home.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/comui_tab_home_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable-xxhdpi/comui_tab_home_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/comui_tab_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable-xxhdpi/comui_tab_message.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/comui_tab_message_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable-xxhdpi/comui_tab_message_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/comui_tab_person.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable-xxhdpi/comui_tab_person.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/comui_tab_person_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable-xxhdpi/comui_tab_person_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/comui_tab_pond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable-xxhdpi/comui_tab_pond.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/comui_tab_pond_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable-xxhdpi/comui_tab_pond_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/comui_tab_post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable-xxhdpi/comui_tab_post.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/lib_update_app_info_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_dialog_delay.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_dialog_tip.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_enjoy_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_enjoy_pink.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_item_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_pub.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_pub_article.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_pub_blog.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_pub_tweet.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_pub_write.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_toast.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_border_nativephoto.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_border_takephoto.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_yellow_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/contact_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable/contact_select.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/contact_select_checkbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/contact_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable/contact_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable/dialog_arrow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_loading2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_loading3.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_loading4.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_loading5.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_loading6.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dialog_loading_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable/dialog_loading_img.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/esf_call_dialog_toast_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/houseajk_bottom_devider.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_nav_add_normal.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 16 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_message.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_person.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_pond.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable/shop.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/tribe_coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazyzhangxl/WindowShowDemo/cca170d5d7c1a2dcbf450ab24fdb64a40af791dc/app/src/main/res/drawable/tribe_coin.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/tribe_toast_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_delay_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 |