GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 完善demo · JingMeng/AndroidCustomView@6cb4418

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app/src/main
    • java/com/allen/androidcustomview/activity
      • ClearScreenActivity.kt
    • res/layout
      • activity_clear_screen.xml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/java/com/allen/androidcustomview/activity/ClearScreenActivity.kt‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/allen/androidcustomview/activity/ClearScreenActivity.kt
+18-1Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ package com.allen.androidcustomview.activity
22

33
import android.os.Bundle
44
import android.support.v7.app.AppCompatActivity
5+
import android.widget.Toast
56
import com.allen.androidcustomview.R
7+
import com.allen.androidcustomview.widget.ClearScreenMode
8+
import com.allen.androidcustomview.widget.ClearScreenView
69
import kotlinx.android.synthetic.main.activity_clear_screen.*
710

811
/**
@@ -13,11 +16,25 @@ import kotlinx.android.synthetic.main.activity_clear_screen.*
1316
* desc :
1417
* </pre>
1518
*/
16-
class ClearScreenActivity : AppCompatActivity() {
19+
class ClearScreenActivity : AppCompatActivity(), ClearScreenView.OnClearScreenListener {
1720

1821
override fun onCreate(savedInstanceState: Bundle?) {
1922
super.onCreate(savedInstanceState)
2023
setContentView(R.layout.activity_clear_screen)
24+
2125
clear_screen_container.addClearView(iv_clear_content)
26+
27+
clear_screen_container.setOnClearScreenListener(this)
28+
29+
btn_quick_clear.setOnClickListener { clear_screen_container.clearScreenMode = ClearScreenMode.QUICK_SCROLL }
30+
btn_slow_clear.setOnClickListener { clear_screen_container.clearScreenMode = ClearScreenMode.SLOW_SCROLL }
31+
}
32+
33+
override fun onCleared() {
34+
Toast.makeText(this, "清屏了", Toast.LENGTH_SHORT).show()
35+
}
36+
37+
override fun onRestored() {
38+
Toast.makeText(this, "恢复了", Toast.LENGTH_SHORT).show()
2239
}
2340
}
Collapse file

‎app/src/main/res/layout/activity_clear_screen.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/layout/activity_clear_screen.xml
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,19 @@
2222
android:gravity="center"
2323
android:scaleType="fitXY"
2424
android:src="@mipmap/live_bg" />
25+
26+
<Button
27+
android:id="@+id/btn_quick_clear"
28+
android:layout_width="wrap_content"
29+
android:layout_height="wrap_content"
30+
android:layout_gravity="bottom"
31+
android:text="快滑清屏模式" />
32+
33+
<Button
34+
android:id="@+id/btn_slow_clear"
35+
android:layout_width="wrap_content"
36+
android:layout_height="wrap_content"
37+
android:layout_gravity="bottom|right"
38+
android:text="慢滑清屏模式" />
2539
</FrameLayout>
2640
</com.allen.androidcustomview.widget.ClearScreenView>

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.