Skip to content

Commit 96eb263

Browse files
committed
Initial commit
0 parents  commit 96eb263

File tree

34 files changed

+1048
-0
lines changed

34 files changed

+1048
-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/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures

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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.2"
6+
7+
defaultConfig {
8+
applicationId "com.brioal.rangeseekbar"
9+
minSdkVersion 15
10+
targetSdkVersion 24
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
compile 'com.android.support:appcompat-v7:24.2.1'
25+
compile project(":rangeseek")
26+
}

app/proguard-rules.pro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in C:\Android\android-sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}

app/src/main/AndroidManifest.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.brioal.rangeseekbar">
4+
5+
<application
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+
<activity android:name=".MainActivity">
12+
<intent-filter>
13+
<action android:name="android.intent.action.MAIN"/>
14+
15+
<category android:name="android.intent.category.LAUNCHER"/>
16+
</intent-filter>
17+
</activity>
18+
</application>
19+
20+
</manifest>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.brioal.rangeseekbar;
2+
3+
import android.os.Bundle;
4+
import android.support.v7.app.AppCompatActivity;
5+
import android.widget.TextView;
6+
7+
import com.brioal.rangeseek.entity.RangeEntity;
8+
import com.brioal.rangeseek.interfaces.OnRangeChangedListener;
9+
import com.brioal.rangeseek.view.RangeBar;
10+
11+
import java.util.ArrayList;
12+
import java.util.List;
13+
14+
public class MainActivity extends AppCompatActivity {
15+
RangeBar mRangeBar;
16+
TextView mTvMin;
17+
TextView mTvMax;
18+
19+
@Override
20+
protected void onCreate(Bundle savedInstanceState) {
21+
super.onCreate(savedInstanceState);
22+
setContentView(R.layout.activity_main);
23+
mRangeBar = (RangeBar) findViewById(R.id.main_container);
24+
mTvMin = (TextView) findViewById(R.id.tv_min);
25+
mTvMax = (TextView) findViewById(R.id.tv_max);
26+
final List<RangeEntity> list = new ArrayList<>();
27+
list.add(new RangeEntity("15℃", 15));
28+
list.add(new RangeEntity("18℃", 18));
29+
list.add(new RangeEntity("21℃", 21));
30+
list.add(new RangeEntity("24℃", 24));
31+
list.add(new RangeEntity("27℃", 27));
32+
list.add(new RangeEntity("30℃", 30));
33+
mRangeBar.setValues(list);
34+
mRangeBar.addOnRangeChangedListener(new OnRangeChangedListener() {
35+
@Override
36+
public void selected(int startIndex, int endIndex) {
37+
mTvMin.setText(list.get(startIndex).getValue() + "");
38+
mTvMax.setText(list.get(endIndex).getValue() + "");
39+
}
40+
});
41+
}
42+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
tools:context="com.brioal.rangeseekbar.MainActivity">
8+
9+
10+
<LinearLayout
11+
android:id="@+id/layout"
12+
android:layout_centerInParent="true"
13+
android:layout_width="match_parent"
14+
android:layout_height="wrap_content">
15+
<com.brioal.rangeseek.view.RangeBar
16+
android:clickable="true"
17+
android:focusable="true"
18+
android:id="@+id/main_container"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:layout_centerInParent="true"/>
22+
23+
</LinearLayout>
24+
<LinearLayout
25+
android:layout_width="match_parent"
26+
android:layout_height="wrap_content"
27+
android:layout_below="@id/layout"
28+
android:orientation="horizontal">
29+
30+
<TextView
31+
android:id="@+id/tv_min"
32+
android:layout_width="wrap_content"
33+
android:layout_height="match_parent"
34+
android:layout_gravity="left|center_vertical"
35+
android:layout_weight="1"
36+
android:gravity="center"
37+
android:text="0"
38+
android:textColor="@color/colorPrimaryDark"
39+
android:textSize="18sp"/>
40+
41+
<TextView
42+
android:id="@+id/tv_max"
43+
android:layout_width="wrap_content"
44+
android:layout_height="match_parent"
45+
android:layout_gravity="right|center_vertical"
46+
android:layout_weight="1"
47+
android:gravity="center"
48+
android:text="5"
49+
android:textColor="@color/colorPrimaryDark"
50+
android:textSize="18sp"/>
51+
</LinearLayout>
52+
</RelativeLayout>
3.34 KB
Loading
2.15 KB
Loading
4.73 KB
Loading

0 commit comments

Comments
 (0)