Skip to content

Commit 5572bbf

Browse files
committed
Initial commit
0 parents  commit 5572bbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1478
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea
5+
.DS_Store
6+
/build
7+
/captures
8+
.externalNativeBuild

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 28
5+
defaultConfig {
6+
applicationId "com.dk.floatingview"
7+
minSdkVersion 19
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+
dependencies {
22+
implementation fileTree(dir: 'libs', include: ['*.jar'])
23+
implementation 'com.android.support:appcompat-v7:28.0.0'
24+
testImplementation 'junit:junit:4.12'
25+
androidTestImplementation 'com.android.support.test:runner:1.0.1'
26+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
27+
implementation project(path: ':floatingview')
28+
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
29+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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

app/src/main/AndroidManifest.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.dk.en.floatingview">
3+
4+
<application
5+
android:name="com.dk.en.floatingview.App"
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme">
11+
12+
<activity
13+
android:name="com.dk.en.floatingview.TestActivity"
14+
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout"
15+
android:resizeableActivity="true">
16+
<intent-filter>
17+
<action android:name="android.intent.action.MAIN" />
18+
<category android:name="android.intent.category.LAUNCHER" />
19+
</intent-filter>
20+
</activity>
21+
<activity android:name="com.dk.en.floatingview.Test1Activity" />
22+
<activity android:name="com.dk.en.floatingview.Test1_1Activity" />
23+
<activity android:name="com.dk.en.floatingview.Test2Activity" />
24+
<activity android:name="com.dk.en.floatingview.Test2_1Activity" />
25+
26+
</application>
27+
</manifest>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.dk.en.floatingview;
2+
3+
import android.app.Application;
4+
import android.widget.Toast;
5+
6+
import com.dk.floatingview.FloatWindow;
7+
import com.dk.floatingview.DkFloatingView;
8+
9+
public class App extends Application {
10+
@Override
11+
public void onCreate() {
12+
super.onCreate();
13+
FloatWindow.with(this)
14+
.setLayoutId(R.layout.float_music)
15+
.build();
16+
FloatWindow.get().setOnClickListener(new DkFloatingView.ViewClickListener() {
17+
@Override
18+
public void onClick(int viewId) {
19+
switch (viewId){
20+
case R.id.iv_player_status:
21+
Toast.makeText(App.this, "状态",Toast.LENGTH_SHORT).show();
22+
break;
23+
case R.id.iv_player_close:
24+
Toast.makeText(App.this, "关闭",Toast.LENGTH_SHORT).show();
25+
break;
26+
case R.id.iv_player_cover:
27+
Toast.makeText(App.this, "封面",Toast.LENGTH_SHORT).show();
28+
break;
29+
}
30+
}
31+
});
32+
}
33+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.dk.en.floatingview;
2+
3+
import android.content.Intent;
4+
import android.os.Bundle;
5+
import android.support.annotation.Nullable;
6+
import android.support.v7.app.AppCompatActivity;
7+
import android.view.View;
8+
import android.widget.TextView;
9+
10+
import com.dk.floatingview.FloatWindow;
11+
12+
/**
13+
* @ClassName TestActivity
14+
* @Description
15+
* @Author Yunpeng Li
16+
* @Creation 2018/3/15 下午5:01
17+
* @Mender Yunpeng Li
18+
* @Modification 2018/3/15 下午5:01
19+
*/
20+
public class Test1Activity extends AppCompatActivity {
21+
22+
@Override
23+
protected void onCreate(@Nullable Bundle savedInstanceState) {
24+
super.onCreate(savedInstanceState);
25+
setContentView(R.layout.main);
26+
((TextView) findViewById(R.id.page_num)).setText("页面Test1Activity");
27+
}
28+
@Override
29+
protected void onResume() {
30+
super.onResume();
31+
FloatWindow.get().hide();
32+
}
33+
34+
public void createActivity(View view) {
35+
Intent intent = new Intent();
36+
intent.setClass(this, Test1_1Activity.class);
37+
startActivity(intent);
38+
}
39+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.dk.en.floatingview;
2+
3+
import android.content.Intent;
4+
import android.os.Bundle;
5+
import android.support.annotation.Nullable;
6+
import android.support.v7.app.AppCompatActivity;
7+
import android.view.View;
8+
import android.widget.TextView;
9+
10+
/**
11+
* @ClassName TestActivity
12+
* @Description
13+
* @Author Yunpeng Li
14+
* @Creation 2018/3/15 下午5:01
15+
* @Mender Yunpeng Li
16+
* @Modification 2018/3/15 下午5:01
17+
*/
18+
public class Test1_1Activity extends AppCompatActivity {
19+
20+
@Override
21+
protected void onCreate(@Nullable Bundle savedInstanceState) {
22+
super.onCreate(savedInstanceState);
23+
setContentView(R.layout.main);
24+
((TextView) findViewById(R.id.page_num)).setText("页面Test1_1Activity");
25+
}
26+
27+
public void createActivity(View view) {
28+
Intent intent = new Intent();
29+
intent.setClass(this, Test2Activity.class);
30+
startActivity(intent);
31+
}
32+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.dk.en.floatingview;
2+
3+
import android.content.Intent;
4+
import android.os.Bundle;
5+
import android.support.annotation.Nullable;
6+
import android.support.v7.app.AppCompatActivity;
7+
import android.view.View;
8+
import android.widget.TextView;
9+
10+
import com.dk.floatingview.FloatWindow;
11+
12+
/**
13+
* @ClassName TestActivity
14+
* @Description
15+
* @Author Yunpeng Li
16+
* @Creation 2018/3/15 下午5:01
17+
* @Mender Yunpeng Li
18+
* @Modification 2018/3/15 下午5:01
19+
*/
20+
public class Test2Activity extends AppCompatActivity {
21+
22+
@Override
23+
protected void onCreate(@Nullable Bundle savedInstanceState) {
24+
super.onCreate(savedInstanceState);
25+
setContentView(R.layout.main);
26+
((TextView) findViewById(R.id.page_num)).setText("页面Test2Activity");
27+
}
28+
@Override
29+
protected void onResume() {
30+
super.onResume();
31+
FloatWindow.get().show();
32+
}
33+
34+
public void createActivity(View view) {
35+
Intent intent = new Intent();
36+
intent.setClass(this, Test2_1Activity.class);
37+
startActivity(intent);
38+
}
39+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.dk.en.floatingview;
2+
3+
import android.content.Intent;
4+
import android.os.Bundle;
5+
import android.support.annotation.Nullable;
6+
import android.support.v7.app.AppCompatActivity;
7+
import android.view.View;
8+
import android.widget.TextView;
9+
10+
/**
11+
* @ClassName TestActivity
12+
* @Description
13+
* @Author Yunpeng Li
14+
* @Creation 2018/3/15 下午5:01
15+
* @Mender Yunpeng Li
16+
* @Modification 2018/3/15 下午5:01
17+
*/
18+
public class Test2_1Activity extends AppCompatActivity {
19+
20+
@Override
21+
protected void onCreate(@Nullable Bundle savedInstanceState) {
22+
super.onCreate(savedInstanceState);
23+
setContentView(R.layout.main);
24+
((TextView) findViewById(R.id.page_num)).setText("页面Test2_1Activity");
25+
}
26+
27+
public void createActivity(View view) {
28+
Intent intent = new Intent();
29+
intent.setClass(this, TestActivity.class);
30+
startActivity(intent);
31+
}
32+
}

0 commit comments

Comments
 (0)