GeezerVison is showing github.com — 好像添加了一个自定义pop · tmexcept/AndroidCustomView@eae6746
File treeExpand file treeCollapse file tree Open diff view settings java/com/allen/androidcustomview
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .gitignore +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 7 | 7 | /captures | 8 | 8 | .externalNativeBuild | 9 | 9 | /.idea | | 10 | +.idea/gradle.xml | | 11 | +.idea/runConfigurations.xml |
Collapse file Copy file name to clipboardExpand all lines: .idea/gradle.xml +1-2Lines changed: 1 addition & 2 deletions Collapse file Copy file name to clipboardExpand all lines: .idea/runConfigurations.xml -12Lines changed: 0 additions & 12 deletions Collapse file Copy file name to clipboardExpand all lines: app/build.gradle +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,6 +21,14 @@ android { | 21 | 21 | } | 22 | 22 | productFlavors { | 23 | 23 | } | | 24 | + sourceSets.main { | | 25 | + res.srcDirs = | | 26 | + [ | | 27 | + 'src/main/res/layouts/custompop', | | 28 | + 'src/main/res/layouts', | | 29 | + 'src/main/res' | | 30 | + ] | | 31 | + } | 24 | 32 | } | 25 | 33 |
| 26 | 34 | dependencies { | |
Collapse file Copy file name to clipboardExpand all lines: app/src/main/AndroidManifest.xml +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 39 | 39 | <activity android:name=".activity.RecyclerViewItemAnimActivity" /> | 40 | 40 | <activity android:name=".activity.PathActivity" /> | 41 | 41 | <activity android:name=".activity.SinaVoteActivity" /> | | 42 | + <activity android:name=".activity.custompop.CustomPopActivity" /> | 42 | 43 | <activity android:name=".gradient.GradientActivity" /> | 43 | 44 | <activity android:name=".activity.TranslateRotateCanvasActivity" /> | 44 | 45 | </application> | |
Collapse file Copy file name to clipboardExpand all lines: app/src/main/java/com/allen/androidcustomview/activity/MainActivity.kt +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,6 +7,7 @@ import android.support.v7.widget.LinearLayoutManager | 7 | 7 | import android.view.View | 8 | 8 | import android.widget.Toast | 9 | 9 | import com.allen.androidcustomview.R | | 10 | +import com.allen.androidcustomview.activity.custompop.CustomPopActivity | 10 | 11 | import com.allen.androidcustomview.adapter.MainAdapter | 11 | 12 | import com.allen.androidcustomview.bean.TypeBean | 12 | 13 | import com.allen.androidcustomview.gradient.GradientActivity | @@ -46,6 +47,7 @@ class MainActivity : AppCompatActivity(), BaseQuickAdapter.OnItemClickListener { | 46 | 47 | typeBeans.add(TypeBean("仿新浪投票控件", index++)) | 47 | 48 | typeBeans.add(TypeBean("Gradient的应用", index++)) | 48 | 49 | typeBeans.add(TypeBean("自定义控件", index++)) | | 50 | + typeBeans.add(TypeBean("自定义Popwindow", index++)) | 49 | 51 | return typeBeans | 50 | 52 | } | 51 | 53 |
| @@ -90,6 +92,7 @@ class MainActivity : AppCompatActivity(), BaseQuickAdapter.OnItemClickListener { | 90 | 92 | 16 -> startActivity(Intent(this@MainActivity, SinaVoteActivity::class.java)) | 91 | 93 | 17 -> startActivity(Intent(this@MainActivity, GradientActivity::class.java)) | 92 | 94 | 18 -> startActivity(Intent(this@MainActivity, TranslateRotateCanvasActivity::class.java)) | | 95 | + 19 -> startActivity(Intent(this@MainActivity, CustomPopActivity::class.java)) | 93 | 96 | } | 94 | 97 | } | 95 | 98 | } |
Collapse file Copy file name to clipboardExpand all lines: app/src/main/java/com/allen/androidcustomview/activity/PathActivity.kt +11Lines changed: 11 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,8 +2,11 @@ package com.allen.androidcustomview.activity | 2 | 2 |
| 3 | 3 | import android.os.Bundle | 4 | 4 | import android.support.v7.app.AppCompatActivity | | 5 | +import android.util.Log | | 6 | +import android.widget.TextView | 5 | 7 | import com.allen.androidcustomview.R | 6 | 8 | import kotlinx.android.synthetic.main.activity_path.* | | 9 | +import java.util.* | 7 | 10 |
| 8 | 11 | /** | 9 | 12 | * <pre> | @@ -22,4 +25,12 @@ class PathActivity : AppCompatActivity() { | 22 | 25 | } | 23 | 26 | } | 24 | 27 |
| | 28 | + override fun onResume() { | | 29 | + super.onResume() | | 30 | + val text: String = "哈哈22jjMM,,,," | | 31 | + val measure = FloatArray(text.length) | | 32 | + tv?.getPaint()?.getTextWidths(text, measure) | | 33 | + Log.e("onResume","measure=" + Arrays.toString(measure)); | | 34 | + | | 35 | + } | 25 | 36 | } |
|