├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── up.png
│ │ │ │ ├── down.png
│ │ │ │ ├── share.png
│ │ │ │ ├── txsp.png
│ │ │ │ ├── download.png
│ │ │ │ ├── collection.png
│ │ │ │ ├── collection_y.png
│ │ │ │ ├── video_source_border_item_select.xml
│ │ │ │ ├── video_source_border_item.xml
│ │ │ │ ├── video_source_show.xml
│ │ │ │ ├── video_source_select.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── layout
│ │ │ │ ├── qq_bottom_page.xml
│ │ │ │ ├── qq_bottom_controls.xml
│ │ │ │ ├── tab_layout.xml
│ │ │ │ ├── tab_controls.xml
│ │ │ │ ├── video_source_list.xml
│ │ │ │ ├── qq_bottom_item.xml
│ │ │ │ ├── video_source_page.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── video_source_controls.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ └── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── controls
│ │ │ └── e4a
│ │ │ └── e4acontrols
│ │ │ ├── MainActivity.java
│ │ │ ├── QQBottomPage.java
│ │ │ ├── controls
│ │ │ ├── QQBottomItem.java
│ │ │ ├── QQBottom.java
│ │ │ ├── TabControls.java
│ │ │ └── VideoSource.java
│ │ │ ├── TabLayoutPage.java
│ │ │ └── VideoSourcePage.java
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── controls
│ │ │ └── e4a
│ │ │ └── e4acontrols
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── controls
│ │ └── e4a
│ │ └── e4acontrols
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── e4a
├── 如意数学.elp
├── 如意高级tab.elp
├── 仿QQ底部类库
│ ├── demo.e4a
│ └── QQBottom.elp
└── HuanL播放源类库
│ ├── demo.e4a
│ └── huanlPlaySource.elp
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── gradle.properties
├── gradlew.bat
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/e4a/如意数学.elp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/e4a/如意数学.elp
--------------------------------------------------------------------------------
/e4a/如意高级tab.elp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/e4a/如意高级tab.elp
--------------------------------------------------------------------------------
/e4a/仿QQ底部类库/demo.e4a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/e4a/仿QQ底部类库/demo.e4a
--------------------------------------------------------------------------------
/e4a/HuanL播放源类库/demo.e4a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/e4a/HuanL播放源类库/demo.e4a
--------------------------------------------------------------------------------
/e4a/仿QQ底部类库/QQBottom.elp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/e4a/仿QQ底部类库/QQBottom.elp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/drawable/up.png
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | e4a Controls
3 |
4 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/drawable/down.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/drawable/share.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/txsp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/drawable/txsp.png
--------------------------------------------------------------------------------
/e4a/HuanL播放源类库/huanlPlaySource.elp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/e4a/HuanL播放源类库/huanlPlaySource.elp
--------------------------------------------------------------------------------
/app/src/main/res/drawable/download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/drawable/download.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/drawable/collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/collection_y.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/drawable/collection_y.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodFrm/e4aControls/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/.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
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed May 23 21:35:22 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/qq_bottom_page.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/qq_bottom_controls.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/tab_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/video_source_border_item_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/video_source_border_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/test/java/com/controls/e4a/e4acontrols/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/video_source_show.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/video_source_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/tab_controls.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
17 |
--------------------------------------------------------------------------------
/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/src/main/res/layout/video_source_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | ## Project-wide Gradle settings.
2 | #
3 | # For more details on how to configure your build environment visit
4 | # http://www.gradle.org/docs/current/userguide/build_environment.html
5 | #
6 | # Specifies the JVM arguments used for the daemon process.
7 | # The setting is particularly useful for tweaking memory settings.
8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m
9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10 | #
11 | # When configured, Gradle will run in incubating parallel mode.
12 | # This option should only be used with decoupled projects. More details, visit
13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14 | # org.gradle.parallel=true
15 | #Sat Apr 07 19:58:31 CST 2018
16 | systemProp.http.proxyHost=127.0.0.1
17 | org.gradle.jvmargs=-Xmx1536m
18 | systemProp.http.proxyPort=1081
19 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/controls/e4a/e4acontrols/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols;
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.controls.e4a.e4acontrols", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/qq_bottom_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
18 |
27 |
28 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | defaultConfig {
6 | applicationId "com.controls.e4a.e4acontrols"
7 | minSdkVersion 15
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:26.1.0'
24 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
25 | testImplementation 'junit:junit:4.12'
26 | androidTestImplementation 'com.android.support.test:runner:1.0.1'
27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
28 |
29 | implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/controls/e4a/e4acontrols/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols;
2 |
3 | import android.content.Intent;
4 | import android.os.Build;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.os.Bundle;
7 | import android.view.View;
8 |
9 | public class MainActivity extends AppCompatActivity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_main);
15 | }
16 |
17 | public void checkVideoSourcePage(View view) {
18 | Intent intent = new Intent(this, VideoSourcePage.class);
19 | startActivity(intent);
20 | }
21 |
22 | public void btnOnClick(View view) {
23 | switch (view.getId()) {
24 | case R.id.qq_bottom:
25 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
26 | getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
27 | }
28 | break;
29 | case R.id.tabLayout:
30 | Intent intent = new Intent(this, TabLayoutPage.class);
31 | startActivity(intent);
32 | break;
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/video_source_page.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
20 |
21 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
19 |
26 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/controls/e4a/e4acontrols/QQBottomPage.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols;
2 |
3 | import android.graphics.BitmapFactory;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.widget.AdapterView;
8 |
9 | import com.controls.e4a.e4acontrols.controls.QQBottom;
10 |
11 | public class QQBottomPage extends AppCompatActivity {
12 |
13 | private QQBottom qqBottom;
14 |
15 | public void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.qq_bottom_page);
18 | qqBottom = new QQBottom(this);
19 | qqBottom.create();
20 |
21 | qqBottom.setOnItemClickListener(new AdapterView.OnItemClickListener() {
22 | @Override
23 | public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
24 |
25 | }
26 | });
27 | qqBottom.addItem("rrr",
28 | BitmapFactory.decodeResource(getResources(), R.drawable.share),
29 | BitmapFactory.decodeResource(getResources(), R.drawable.download)
30 | );
31 |
32 | qqBottom.addItem("haas",
33 | BitmapFactory.decodeResource(getResources(), R.drawable.down),
34 | BitmapFactory.decodeResource(getResources(), R.drawable.download)
35 | );
36 |
37 |
38 | qqBottom.addItem("haha",
39 | BitmapFactory.decodeResource(getResources(), R.drawable.txsp),
40 | BitmapFactory.decodeResource(getResources(), R.drawable.download)
41 | );
42 |
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/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/java/com/controls/e4a/e4acontrols/controls/QQBottomItem.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols.controls;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.view.LayoutInflater;
6 | import android.widget.ImageView;
7 | import android.widget.LinearLayout;
8 | import android.widget.TextView;
9 |
10 | import com.controls.e4a.e4acontrols.R;
11 |
12 | public class QQBottomItem extends LinearLayout {
13 |
14 | private ImageView imgCtrl;
15 | private TextView textCtrl;
16 | private String showText;
17 |
18 | private Bitmap bitmap;
19 | private Bitmap activeImg;
20 |
21 | private int color;
22 | private int activeColor;
23 |
24 | public QQBottomItem(Context context, String text, int color, int activeColor, Bitmap bitmap, Bitmap activeImg) {
25 | super(context);
26 | this.bitmap = bitmap;
27 | this.activeImg = activeImg;
28 | this.color = color;
29 | this.activeColor = activeColor;
30 | // 加载布局
31 | LayoutInflater.from(context).inflate(R.layout.qq_bottom_item, this);
32 | showText = text;
33 | textCtrl = (TextView) findViewById(R.id.text);
34 | imgCtrl = (ImageView) findViewById(R.id.img);
35 |
36 | textCtrl.setText(text);
37 | textCtrl.setTextColor(color);
38 | imgCtrl.setImageBitmap(bitmap);
39 |
40 | }
41 |
42 | public void setFontSize(int size) {
43 | textCtrl.setTextSize(size);
44 | }
45 |
46 | public void setHeight(int a) {
47 | LinearLayout.LayoutParams l = (LinearLayout.LayoutParams) textCtrl.getLayoutParams();
48 | l.height = a;
49 | textCtrl.setLayoutParams(l);
50 | }
51 |
52 | public void setActive(boolean active) {
53 | if (active) {
54 | textCtrl.setTextColor(activeColor);
55 | imgCtrl.setImageBitmap(activeImg);
56 | } else {
57 | textCtrl.setTextColor(color);
58 | imgCtrl.setImageBitmap(bitmap);
59 | }
60 | }
61 |
62 | public String getText() {
63 | return showText;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/com/controls/e4a/e4acontrols/TabLayoutPage.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 |
6 | import com.controls.e4a.e4acontrols.controls.TabControls;
7 | import com.flyco.tablayout.listener.OnTabSelectListener;
8 |
9 | public class TabLayoutPage extends AppCompatActivity {
10 |
11 | private TabControls tabControls;
12 |
13 | public void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.tab_layout);
16 | tabControls = new TabControls(this);
17 | tabControls.监听事件(new OnTabSelectListener() {
18 | @Override
19 | public void onTabSelect(int position) {
20 |
21 | }
22 |
23 | @Override
24 | public void onTabReselect(int position) {
25 |
26 | }
27 | });
28 | tabControls.create();
29 | // tabControls.添加一项("测试", R.drawable.collection, R.drawable.collection_y);
30 | // tabControls.添加一项("测试1", R.drawable.down, R.drawable.download);
31 | tabControls.添加一项2(new String[]{"我","爱","你"});
32 | // tabControls.设置背景色("#ffffff");
33 | // tabControls.设置字体未选中颜色("#000000");
34 | //// tabControls.设置分割线颜色("#ffee00");
35 | //// tabControls.设置分割线宽度(1);
36 | // tabControls.设置字体选中颜色("#ff0000");
37 | // tabControls.设置下划线方向(false);
38 | //// tabControls.设置下划线弧度(30);
39 | //// tabControls.设置下划线高度(4);
40 | // tabControls.图标可见(false);
41 | //// tabControls.设置项目背景颜色("#7861f2");
42 | //// tabControls.设置项目消息(3,3);
43 | //// tabControls.设置下划线背景颜色("#55ee88");
44 | //// tabControls.设置下划线颜色("#665181");
45 | //// tabControls.设置下划线宽度(50);
46 | // tabControls.设置下划线弧度(20);
47 | // tabControls.设置下划线高度(40);
48 | // tabControls.设置下划线样式(2);
49 | // tabControls.设置下划线外边距(5,5,0,0);
50 | tabControls.初始化();
51 | // tabControls.设置项目消息(1,23);
52 | // tabControls.设置消息间隔(1,-5,5);
53 | // tabControls.小红点(0);
54 | // tabControls.设置消息间隔(0,-5,5);
55 | // tabControls.加粗(1);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/com/controls/e4a/e4acontrols/VideoSourcePage.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.BitmapFactory;
5 | import android.os.Bundle;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.util.Log;
8 | import android.view.View;
9 | import android.widget.AdapterView;
10 | import android.widget.SimpleAdapter;
11 |
12 | import com.controls.e4a.e4acontrols.controls.VideoSource;
13 |
14 | import java.nio.ByteBuffer;
15 | import java.util.ArrayList;
16 | import java.util.HashMap;
17 | import java.util.List;
18 | import java.util.Map;
19 | import java.util.Random;
20 |
21 | public class VideoSourcePage extends AppCompatActivity {
22 |
23 | private VideoSource videoSource;
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | setContentView(R.layout.video_source_page);
29 | videoSource = new VideoSource(this);
30 | videoSource.create();
31 | Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.collection);
32 | videoSource.addItem("ceshi", "12", bitmap);
33 | videoSource.addItem("down", "12415", BitmapFactory.decodeResource(getResources(), R.drawable.download));
34 | videoSource.addItem("测试", "412", BitmapFactory.decodeResource(getResources(), R.drawable.share));
35 | videoSource.addItem("测试", "12323", BitmapFactory.decodeResource(getResources(), R.drawable.share));
36 | videoSource.setOnItemClickListener(new AdapterView.OnItemClickListener() {
37 | @Override
38 | public void onItemClick(AdapterView> adapterView, View view, int i, long l) {
39 |
40 | }
41 | });
42 |
43 | videoSource.setOnActionListener(new VideoSource.OnActionListener() {
44 | @Override
45 | public void onAction(int var1) {
46 | // Log.e("VideoSourcePage", videoSource.getUrl(var1));
47 | }
48 | });
49 | videoSource.setSelection(2);
50 | }
51 |
52 | public void btnOnClick(View view) {
53 | switch (view.getId()) {
54 | case R.id.removeall:
55 | videoSource.removeAll();
56 | break;
57 | case R.id.add:
58 | Random random=new Random();
59 | Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.collection);
60 | String t=Integer.toString(random.nextInt());
61 | videoSource.addItem(t, t, bitmap);
62 |
63 | }
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/video_source_controls.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
20 |
26 |
27 |
36 |
37 |
43 |
44 |
50 |
51 |
52 |
53 |
54 |
59 |
60 |
67 |
68 |
75 |
76 |
83 |
84 |
85 |
86 |
92 |
93 |
98 |
99 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/app/src/main/java/com/controls/e4a/e4acontrols/controls/QQBottom.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols.controls;
2 |
3 |
4 | import android.app.Activity;
5 | import android.content.Context;
6 | import android.graphics.Bitmap;
7 | import android.graphics.Color;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.AdapterView;
12 | import android.widget.LinearLayout;
13 |
14 | import com.controls.e4a.e4acontrols.R;
15 |
16 | import java.util.ArrayList;
17 |
18 | public class QQBottom {
19 |
20 | private int color = Color.parseColor("#cccccc");
21 |
22 | private int activeColor = Color.parseColor("#000000");
23 |
24 | private int fontSize = 12;
25 |
26 | private Context mContext;
27 | private View contView;
28 |
29 | private ArrayList items = new ArrayList<>();
30 |
31 | private QQBottomItem activeQQBottomItem = null;
32 | private AdapterView.OnItemClickListener itemClickListener;
33 |
34 | public QQBottom(Context context) {
35 | mContext = context;
36 | }
37 |
38 | private int textHeight = 0;
39 |
40 | public void setTextHeight(int h) {
41 | textHeight = h;
42 | }
43 |
44 | public View create() {
45 | LayoutInflater inflater = LayoutInflater.from(mContext);
46 | contView = inflater.inflate(R.layout.qq_bottom_controls, null);
47 | LinearLayout.LayoutParams rllp = new LinearLayout.LayoutParams(-1, -1);
48 | rllp.width = ViewGroup.LayoutParams.MATCH_PARENT;
49 | rllp.height = 140;
50 | ((Activity) mContext).addContentView(contView, rllp);
51 | return contView;
52 | }
53 |
54 | public void setColor(String color) {
55 | this.color = Color.parseColor(color);
56 | }
57 |
58 | public void setActiveColor(String color) {
59 | this.activeColor = Color.parseColor(color);
60 | }
61 |
62 | public int addItem(String text, Bitmap bitmap, Bitmap active) {
63 | final QQBottomItem qqBottomItem = new QQBottomItem(contView.getContext(), text, (color),
64 | (activeColor), bitmap, active);
65 | LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
66 | layoutParams.weight = 10;
67 | qqBottomItem.setLayoutParams(layoutParams);
68 | ((LinearLayout) contView).addView(qqBottomItem, layoutParams);
69 | items.add(qqBottomItem);
70 | if (textHeight > 0) {
71 | qqBottomItem.setHeight(textHeight);
72 | }
73 | qqBottomItem.setFontSize(fontSize);
74 | qqBottomItem.setId(items.size() - 1);
75 | qqBottomItem.setOnClickListener(new View.OnClickListener() {
76 | @Override
77 | public void onClick(View view) {
78 | try {
79 | activeQQBottomItem.setActive(false);
80 | } catch (Exception e) {
81 |
82 | }
83 | qqBottomItem.setActive(true);
84 | activeQQBottomItem = qqBottomItem;
85 | itemClickListener.onItemClick(null, view, qqBottomItem.getId(), 0);
86 | }
87 | });
88 | contView.requestLayout();
89 | return items.size() - 1;
90 | }
91 |
92 |
93 | public void remove(int index) {
94 | try {
95 | QQBottomItem v = (QQBottomItem) contView.findViewById(index);
96 | ViewGroup p = (ViewGroup) v.getParent();
97 | p.removeView(v);
98 | for (int i = index + 1; i < items.size(); i++) {
99 | v = items.get(i);
100 | v.setId(i - 1);
101 | }
102 | } catch (Exception e) {
103 |
104 | }
105 | contView.requestLayout();
106 | }
107 |
108 | public void removeAll() {
109 | for (int i = 0; i < items.size(); i++) {
110 | try {
111 | QQBottomItem v = (QQBottomItem) contView.findViewById(i);
112 | if (v == null) {
113 | continue;
114 | }
115 | ViewGroup p = (ViewGroup) v.getParent();
116 | p.removeView(v);
117 | } catch (Exception e) {
118 |
119 | }
120 | }
121 | items.clear();
122 | contView.requestLayout();
123 | }
124 |
125 | public void selectItem(int id) {
126 | try {
127 | activeQQBottomItem.setActive(false);
128 | } catch (Exception e) {
129 |
130 | }
131 |
132 | try {
133 | QQBottomItem qqBottomItem = (QQBottomItem) contView.findViewById(id);
134 | qqBottomItem.setActive(true);
135 | activeQQBottomItem = qqBottomItem;
136 | } catch (Exception e) {
137 |
138 | }
139 | contView.requestLayout();
140 | }
141 |
142 | public void setOnItemClickListener(AdapterView.OnItemClickListener listener) {
143 | itemClickListener = listener;
144 | }
145 |
146 | public void setFontSize(int size) {
147 | this.fontSize = size;
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/app/src/main/java/com/controls/e4a/e4acontrols/controls/TabControls.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols.controls;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.graphics.Color;
6 | import android.view.Gravity;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.LinearLayout;
11 |
12 | import com.controls.e4a.e4acontrols.R;
13 | import com.flyco.tablayout.CommonTabLayout;
14 | import com.flyco.tablayout.listener.CustomTabEntity;
15 | import com.flyco.tablayout.listener.OnTabSelectListener;
16 |
17 | import java.util.ArrayList;
18 |
19 | public class TabControls {
20 |
21 | private Context mContext;
22 | private View contView;
23 | private CommonTabLayout commonTabLayout;
24 | private ArrayList mTabEntities = new ArrayList<>();
25 |
26 | public TabControls(Context context) {
27 | mContext = context;
28 | }
29 |
30 | public View create() {
31 | LayoutInflater inflater = LayoutInflater.from(mContext);
32 | contView = inflater.inflate(R.layout.tab_controls, null);
33 | LinearLayout.LayoutParams rllp = new LinearLayout.LayoutParams(-1, -1);
34 | rllp.width = ViewGroup.LayoutParams.MATCH_PARENT;
35 | rllp.height = 140;
36 | ((Activity) mContext).addContentView(contView, rllp);
37 | commonTabLayout = contView.findViewById(R.id.tab_controls);
38 |
39 | 设置背景色("#ffffff");
40 | 设置字体未选中颜色("#000000");
41 | 设置字体选中颜色("#ff0000");
42 | 设置下划线方向(false);
43 | 设置下划线颜色("#b3daf3");
44 | return contView;
45 | }
46 |
47 | public void 监听事件(OnTabSelectListener event){
48 | commonTabLayout.setOnTabSelectListener(event);
49 | }
50 |
51 | public void 初始化() {
52 | commonTabLayout.setTabData(mTabEntities);
53 | }
54 |
55 | public void 设置字体选中颜色(String color) {
56 | commonTabLayout.setTextSelectColor(Color.parseColor(color));
57 | }
58 |
59 | public void 设置字体未选中颜色(String color) {
60 | commonTabLayout.setTextUnselectColor(Color.parseColor(color));
61 | }
62 |
63 | public void 设置图标高度(int h) {
64 | commonTabLayout.setIconHeight(h);
65 | }
66 |
67 | public void 设置分割线颜色(String color) {
68 | commonTabLayout.setDividerColor(Color.parseColor(color));
69 | }
70 |
71 | public void 设置分割线宽度(int w) {
72 | commonTabLayout.setDividerWidth(w);
73 | }
74 |
75 | public void 设置字体大小(float size) {
76 | commonTabLayout.setTextsize(size);
77 | }
78 |
79 | public void 设置下划线方向(Boolean top) {
80 | if (top) {
81 | commonTabLayout.setUnderlineGravity(Gravity.TOP);
82 | } else {
83 | commonTabLayout.setUnderlineGravity(Gravity.BOTTOM);
84 | }
85 |
86 | }
87 |
88 | public void 设置项目背景颜色(String color) {
89 | commonTabLayout.setIndicatorColor(Color.parseColor(color));
90 | }
91 |
92 | public void 设置下划线样式(int style) {
93 | commonTabLayout.setIndicatorStyle(style);
94 | }
95 |
96 | public void 设置下划线弧度(float h) {
97 | commonTabLayout.setIndicatorCornerRadius(h);
98 | }
99 |
100 | public void 设置下划线背景颜色(String color) {
101 | commonTabLayout.setUnderlineColor(Color.parseColor(color));
102 | }
103 |
104 | public void 设置下划线颜色(String color) {
105 | commonTabLayout.setIndicatorColor(Color.parseColor(color));
106 | }
107 |
108 | public void 设置下划线外边距(float l, float t, float r, float b) {
109 | commonTabLayout.setIndicatorMargin(l, t, r, b);
110 | }
111 |
112 | public void 设置项目消息(int index, int num) {
113 | commonTabLayout.showMsg(index, num);
114 | }
115 |
116 | public void 设置消息间隔(int index, int l, int r) {
117 | commonTabLayout.setMsgMargin(index, l, r);
118 | }
119 |
120 | public void 小红点(int index) {
121 | commonTabLayout.showDot(index);
122 | }
123 |
124 | public void 设置下划线高度(float h) {
125 | commonTabLayout.setUnderlineHeight(h);
126 | commonTabLayout.setIndicatorHeight(h);
127 | }
128 |
129 | public void 设置下划线宽度(float w) {
130 | commonTabLayout.setIndicatorWidth(w);
131 | }
132 |
133 | public void 加粗(int b) {
134 | commonTabLayout.setTextBold(b);
135 | }
136 |
137 | public void 图标可见(boolean show) {
138 | commonTabLayout.setIconVisible(show);
139 | }
140 |
141 | public void 设置背景色(String color) {
142 | commonTabLayout.setBackgroundColor(Color.parseColor(color));
143 | }
144 |
145 | public void 添加一项(String 标题, int 选中图片, int 未选中图片) {
146 | mTabEntities.add(new TabEntity(标题, 选中图片, 未选中图片));
147 | }
148 |
149 | public void 添加一项2(String[] 标题s) {
150 | for (int i = 0; i < 标题s.length; i++) {
151 | mTabEntities.add(new TabEntity(标题s[i], 0, 0));
152 | }
153 | }
154 |
155 |
156 | }
157 |
158 | class TabEntity implements CustomTabEntity {
159 | public String title;
160 | public int selectedIcon;
161 | public int unSelectedIcon;
162 |
163 | public TabEntity(String title, int selectedIcon, int unSelectedIcon) {
164 | this.title = title;
165 | this.selectedIcon = selectedIcon;
166 | this.unSelectedIcon = unSelectedIcon;
167 | }
168 |
169 | @Override
170 | public String getTabTitle() {
171 | return title;
172 | }
173 |
174 | @Override
175 | public int getTabSelectedIcon() {
176 | return selectedIcon;
177 | }
178 |
179 | @Override
180 | public int getTabUnselectedIcon() {
181 | return unSelectedIcon;
182 | }
183 | }
184 |
185 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/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/java/com/controls/e4a/e4acontrols/controls/VideoSource.java:
--------------------------------------------------------------------------------
1 | package com.controls.e4a.e4acontrols.controls;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.graphics.Bitmap;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.AdapterView;
10 | import android.widget.FrameLayout;
11 | import android.widget.GridView;
12 | import android.widget.ImageView;
13 | import android.widget.LinearLayout;
14 | import android.widget.RelativeLayout;
15 | import android.widget.SimpleAdapter;
16 | import android.widget.TextView;
17 |
18 | import com.controls.e4a.e4acontrols.R;
19 |
20 | import java.util.ArrayList;
21 | import java.util.HashMap;
22 | import java.util.List;
23 | import java.util.Map;
24 |
25 | public class VideoSource {
26 | private final Context mContext;
27 | private GridView sourceList;
28 | private ImageView selectIcon;
29 | private ImageView showIcon;
30 | private TextView selectText;
31 | private SimpleAdapter simpleAdapter;
32 | private List