Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
Widget
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Android Widget
Widget
Commits
d77725d0
Commit
d77725d0
authored
Jun 18, 2020
by
王韦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[new] 增加 键盘库
parent
df0012b3
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
2466 additions
and
19 deletions
+2466
-19
keyboard_delete.png
KeyBoardView/src/main/res/drawable-xhdpi/keyboard_delete.png
+0
-0
btn_keyboard_key_normal.xml
...ardView/src/main/res/drawable/btn_keyboard_key_normal.xml
+13
-0
btn_keyboard_key_pressed.xml
...rdView/src/main/res/drawable/btn_keyboard_key_pressed.xml
+13
-0
keyboard_background.xml
KeyBoardView/src/main/res/drawable/keyboard_background.xml
+4
-0
build.gradle
app/build.gradle
+2
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-2
DemoDialogFragmemt.kt
.../main/java/com/qimai/android/widget/DemoDialogFragmemt.kt
+6
-7
DrawerActivity.java
...rc/main/java/com/qimai/android/widget/DrawerActivity.java
+37
-0
DrawerLayout.java
app/src/main/java/com/qimai/android/widget/DrawerLayout.java
+2275
-0
MainActivity.kt
app/src/main/java/com/qimai/android/widget/MainActivity.kt
+6
-3
StoreLocalLayout.kt
...rc/main/java/com/qimai/android/widget/StoreLocalLayout.kt
+1
-4
activity_drawer.xml
app/src/main/res/layout/activity_drawer.xml
+50
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+24
-3
other_layout.xml
app/src/main/res/layout/other_layout.xml
+16
-0
attrs.xml
app/src/main/res/values/attrs.xml
+9
-0
dimens.xml
app/src/main/res/values/dimens.xml
+4
-0
styles.xml
app/src/main/res/values/styles.xml
+2
-0
settings.gradle
settings.gradle
+1
-0
No files found.
KeyBoardView/src/main/res/drawable-xhdpi/keyboard_delete.png
0 → 100644
View file @
d77725d0
1.34 KB
KeyBoardView/src/main/res/drawable/btn_keyboard_key_normal.xml
0 → 100644
View file @
d77725d0
<?xml version="1.0" encoding="utf-8"?>
<shape
android:shape=
"oval"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#ffffff"
/>
<stroke
android:width=
"1dp"
android:color=
"#FFDB2D"
/>
<size
android:width=
"50dp"
android:height=
"50dp"
/>
</shape>
\ No newline at end of file
KeyBoardView/src/main/res/drawable/btn_keyboard_key_pressed.xml
0 → 100644
View file @
d77725d0
<?xml version="1.0" encoding="utf-8"?>
<shape
android:shape=
"oval"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#FFDB2D"
/>
<stroke
android:width=
"1dp"
android:color=
"#FFDB2D"
/>
<size
android:width=
"50dp"
android:height=
"50dp"
/>
</shape>
\ No newline at end of file
KeyBoardView/src/main/res/drawable/keyboard_background.xml
0 → 100644
View file @
d77725d0
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#ffffff"
/>
</shape>
\ No newline at end of file
app/build.gradle
View file @
d77725d0
...
@@ -29,6 +29,7 @@ dependencies {
...
@@ -29,6 +29,7 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.0.2'
implementation
'androidx.appcompat:appcompat:1.0.2'
implementation
'androidx.core:core-ktx:1.0.2'
implementation
'androidx.core:core-ktx:1.0.2'
implementation
'androidx.constraintlayout:constraintlayout:1.1.3'
implementation
'androidx.constraintlayout:constraintlayout:1.1.3'
implementation
project
(
path:
':KeyBoardView'
)
testImplementation
'junit:junit:4.12'
testImplementation
'junit:junit:4.12'
androidTestImplementation
'androidx.test:runner:1.2.0'
androidTestImplementation
'androidx.test:runner:1.2.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
...
@@ -36,6 +37,7 @@ dependencies {
...
@@ -36,6 +37,7 @@ dependencies {
// implementation 'com.qmai.android.sdk:widgetlib:1.1.2-SNAPSHOT'
// implementation 'com.qmai.android.sdk:widgetlib:1.1.2-SNAPSHOT'
implementation
project
(
path:
':tools'
)
implementation
project
(
path:
':tools'
)
implementation
'androidx.recyclerview:recyclerview:1.0.0'
implementation
'androidx.recyclerview:recyclerview:1.0.0'
implementation
'com.github.sebdomdev:android-drawer-sheet:1.0'
// todo test
// todo test
...
...
app/src/main/AndroidManifest.xml
View file @
d77725d0
...
@@ -9,11 +9,12 @@
...
@@ -9,11 +9,12 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".GridDividerActivity"
/>
<activity
android:name=
".DrawerActivity"
/>
<activity
android:name=
".GridDividerActivity"
/>
<activity
android:name=
".TipActivity"
/>
<activity
android:name=
".TipActivity"
/>
<activity
android:name=
".CommomPopActivity"
/>
<activity
android:name=
".CommomPopActivity"
/>
<activity
android:name=
".TopBarActivity"
/>
<activity
android:name=
".TopBarActivity"
/>
<activity
android:name=
".MainActivity"
>
<activity
android:name=
"
com.qimai.android.widget
.MainActivity"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
app/src/main/java/com/qimai/android/widget/DemoDialogFragmemt.kt
View file @
d77725d0
package
com.qimai.android.widget
package
com.qimai.android.widget
import
android.app.Activity
import
android.content.Context
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
...
@@ -27,15 +24,17 @@ class DemoDialogFragmemt :
...
@@ -27,15 +24,17 @@ class DemoDialogFragmemt :
return
view
!!
return
view
!!
}
}
override
fun
onAttach
(
context
:
Context
?)
{
super
.
onAttach
(
context
)
}
override
fun
config
():
DialogFramgentConfig
{
override
fun
config
():
DialogFramgentConfig
{
return
DialogFramgentConfig
().
apply
{
return
DialogFramgentConfig
().
apply
{
mWindowWidth
=
getScreenWidth
(
context
!!
)
-
context
!!
.
dpTopx
(
30.0f
)
context
?.
let
{
c
->
mWindowWidth
=
getScreenWidth
(
c
)
-
c
.
dpTopx
(
30.0f
)
}
}
}
}
}
...
...
app/src/main/java/com/qimai/android/widget/DrawerActivity.java
0 → 100644
View file @
d77725d0
package
com
.
qimai
.
android
.
widget
;
import
android.os.Bundle
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.FrameLayout
;
import
androidx.appcompat.app.AppCompatActivity
;
public
class
DrawerActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_drawer
);
final
FrameLayout
frameLayout
=
findViewById
(
R
.
id
.
left
);
final
DrawerLayout
drawer
=
findViewById
(
R
.
id
.
drawer
);
Button
btn
=
findViewById
(
R
.
id
.
btn_context
);
btn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
frameLayout
.
removeAllViews
();
frameLayout
.
addView
(
LayoutInflater
.
from
(
DrawerActivity
.
this
).
inflate
(
R
.
layout
.
other_layout
,
null
));
drawer
.
invalidate
();
drawer
.
openDrawer
(
Gravity
.
LEFT
);
}
});
}
}
\ No newline at end of file
app/src/main/java/com/qimai/android/widget/DrawerLayout.java
0 → 100644
View file @
d77725d0
This diff is collapsed.
Click to expand it.
app/src/main/java/com/qimai/android/widget/MainActivity.kt
View file @
d77725d0
...
@@ -3,9 +3,10 @@ package com.qimai.android.widget
...
@@ -3,9 +3,10 @@ package com.qimai.android.widget
import
android.content.Intent
import
android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
android.widget.Button
import
android.widget.Button
import
android.widget.T
oast
import
android.widget.T
extView
import
androidx.appcompat.app.AppCompatActivity
import
androidx.appcompat.app.AppCompatActivity
import
com.qimai.android.widgetlib.toast.HolderContext
import
com.qimai.android.widgetlib.toast.HolderContext
import
kotlinx.android.synthetic.main.activity_main.*
class
MainActivity
:
AppCompatActivity
()
{
class
MainActivity
:
AppCompatActivity
()
{
...
@@ -15,7 +16,6 @@ class MainActivity : AppCompatActivity() {
...
@@ -15,7 +16,6 @@ class MainActivity : AppCompatActivity() {
HolderContext
.
getInstance
().
register
{
HolderContext
.
getInstance
().
register
{
this
this
}
}
supportFragmentManager
findViewById
<
Button
>(
R
.
id
.
commonPop
).
setOnClickListener
{
findViewById
<
Button
>(
R
.
id
.
commonPop
).
setOnClickListener
{
// ToastUtils.getInstance().showCenter("测试测试")
// ToastUtils.getInstance().showCenter("测试测试")
...
@@ -26,12 +26,15 @@ class MainActivity : AppCompatActivity() {
...
@@ -26,12 +26,15 @@ class MainActivity : AppCompatActivity() {
// val loding = Loading()
// val loding = Loading()
// loding.isCancelable =false
// loding.isCancelable =false
// loding.show(supportFragmentManager, "loading")
// loding.show(supportFragmentManager, "loading")
Toast
.
makeText
(
this
,
""
,
Toast
.
LENGTH_SHORT
);
// TestWindow(this, findViewById<Button>(R.id.commonPop)).build().show()
// TestWindow(this, findViewById<Button>(R.id.commonPop)).build().show()
// CustomToastUtils.getInstance().success()
// CustomToastUtils.getInstance().success()
}
}
keyboard
.
bindEditText
(
inputText
)
findViewById
<
TextView
>(
R
.
id
.
drawer
).
setOnClickListener
{
startActivity
(
Intent
(
MainActivity
@
this
,
DrawerActivity
::
class
.
java
))
}
findViewById
<
Button
>(
R
.
id
.
tip
).
setOnClickListener
{
findViewById
<
Button
>(
R
.
id
.
tip
).
setOnClickListener
{
startActivity
(
Intent
(
MainActivity
@
this
,
TipActivity
::
class
.
java
))
startActivity
(
Intent
(
MainActivity
@
this
,
TipActivity
::
class
.
java
))
...
...
app/src/main/java/com/qimai/android/widget/StoreLocalLayout.kt
View file @
d77725d0
...
@@ -18,10 +18,7 @@ class StoreLocalLayout : ViewGroup {
...
@@ -18,10 +18,7 @@ class StoreLocalLayout : ViewGroup {
context
,
context
,
attrs
,
attrs
,
defStyleAttr
defStyleAttr
)
{
)
}
private
val
mAllView
=
mutableListOf
<
List
<
View
>>()
private
val
mAllView
=
mutableListOf
<
List
<
View
>>()
private
val
mLineHeight
=
mutableListOf
<
Int
>()
private
val
mLineHeight
=
mutableListOf
<
Int
>()
...
...
app/src/main/res/layout/activity_drawer.xml
0 → 100644
View file @
d77725d0
<?xml version="1.0" encoding="utf-8"?>
<com.qimai.android.widget.DrawerLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/drawer"
tools:context=
".DrawerActivity"
>
<!-- 内容 -->
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<Button
android:id=
"@+id/btn_context"
android:text=
"context"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</FrameLayout>
<!-- 左边菜单 -->
<FrameLayout
android:id=
"@+id/left"
android:background=
"@color/colorAccent"
android:layout_gravity=
"start"
android:layout_width=
"200dp"
android:layout_height=
"match_parent"
>
<Button
android:id=
"@+id/btn_left_menu"
android:text=
"left menu"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</FrameLayout>
<!-- 左边菜单 -->
<FrameLayout
android:id=
"@+id/RightContainer"
android:background=
"@color/colorAccent"
android:layout_gravity=
"end"
android:layout_width=
"200dp"
android:layout_height=
"match_parent"
>
<Button
android:id=
"@+id/right"
android:text=
"left menu"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</FrameLayout>
</com.qimai.android.widget.DrawerLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
d77725d0
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
<ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:orientation=
"vertical"
...
@@ -18,6 +16,7 @@
...
@@ -18,6 +16,7 @@
android:text=
"topbar"
android:text=
"topbar"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
/>
android:layout_height=
"50dp"
/>
<Button
<Button
android:id=
"@+id/commonPop"
android:id=
"@+id/commonPop"
android:text=
"commonPop"
android:text=
"commonPop"
...
@@ -29,21 +28,30 @@
...
@@ -29,21 +28,30 @@
android:text=
"Tip"
android:text=
"Tip"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
/>
android:layout_height=
"50dp"
/>
<Button
<Button
android:id=
"@+id/divide"
android:id=
"@+id/divide"
android:text=
"griddivider"
android:text=
"griddivider"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
/>
android:layout_height=
"50dp"
/>
<Button
android:id=
"@+id/drawer"
android:text=
"drawer"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
/>
<TextView
<TextView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:text=
"测试111111 "
android:text=
"测试111111 "
android:gravity=
"center"
android:gravity=
"center"
android:textColor=
"@color/colorAccent"
android:textColor=
"@color/colorAccent"
android:layout_height=
"20dp"
/>
android:layout_height=
"20dp"
/>
<com.qimai.android.widget.StoreLocalLayout
<com.qimai.android.widget.StoreLocalLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"100dp"
>
android:layout_height=
"100dp"
>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:text=
"测试111111 "
android:text=
"测试111111 "
...
@@ -51,6 +59,19 @@
...
@@ -51,6 +59,19 @@
android:layout_height=
"20dp"
/>
android:layout_height=
"20dp"
/>
</com.qimai.android.widget.StoreLocalLayout>
</com.qimai.android.widget.StoreLocalLayout>
<EditText
android:id=
"@+id/inputText"
android:textColor=
"#000000"
android:textSize=
"22sp"
tools:text=
"2222"
android:layout_width=
"match_parent"
android:layout_height=
"80dp"
/>
<com.qmai.android.keyboard.NumberKeyBoard
android:id=
"@+id/keyboard"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/layout/other_layout.xml
0 → 100644
View file @
d77725d0
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:id=
"@+id/textView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"车道上的金佛耳机佛"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/values/attrs.xml
0 → 100644
View file @
d77725d0
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr
name=
"qmdrawerLayoutStyle"
format=
"reference"
/>
<attr
name=
"elevation"
format=
"dimension"
/>
<declare-styleable
name=
"QmDrawerLayout"
>
<!-- The height difference between the drawer and the base surface. Only takes effect on API 21 and above -->
<attr
name=
"elevation"
/>
</declare-styleable>
</resources>
\ No newline at end of file
app/src/main/res/values/dimens.xml
0 → 100644
View file @
d77725d0
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen
name=
"qm_def_drawer_elevation"
>
10dp
</dimen>
</resources>
\ No newline at end of file
app/src/main/res/values/styles.xml
View file @
d77725d0
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
<item
name=
"qmKeyboardViewStyle"
>
@style/Widget.qmKeyboardViewStyleValue
</item>
</style>
</style>
<style
name=
"tangshi"
>
<style
name=
"tangshi"
>
<item
name=
"overlay_radius"
>
5dp
</item>
<item
name=
"overlay_radius"
>
5dp
</item>
...
...
settings.gradle
View file @
d77725d0
include
':KeyBoardView'
include
':app'
,
':widgetlib'
,
':tools'
,
':smallwidget'
,
':usefulltool'
include
':app'
,
':widgetlib'
,
':tools'
,
':smallwidget'
,
':usefulltool'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment