-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb5b6aa
commit 633e03b
Showing
15 changed files
with
239 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
app/src/main/java/cn/qqtheme/androidpicker/NestActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package cn.qqtheme.androidpicker; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import java.util.Arrays; | ||
|
||
import cn.qqtheme.framework.picker.TimePicker; | ||
import cn.qqtheme.framework.widget.WheelView; | ||
|
||
/** | ||
* 内嵌选择器 | ||
* <br /> | ||
* Author:李玉江[QQ:1032694760] | ||
* DateTime:2016/12/16 00:42 | ||
* Builder:Android Studio | ||
*/ | ||
public class NestActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_nest); | ||
final TextView textView = (TextView) findViewById(R.id.wheelview_tips); | ||
WheelView wheelView = (WheelView) findViewById(R.id.wheelview_single); | ||
//noinspection RedundantArrayCreation | ||
wheelView.setItems(Arrays.asList(new String[]{ | ||
"贵州穿青人", | ||
"少数民族", | ||
"不在56少数个民族之列", | ||
"第57个民族"})); | ||
wheelView.setOnWheelListener(new WheelView.OnWheelListener() { | ||
@Override | ||
public void onSelected(boolean isUserScroll, int index, String item) { | ||
textView.setText("index=" + index + ",item=" + item); | ||
} | ||
}); | ||
final TimePicker picker = new TimePicker(this, TimePicker.HOUR_12); | ||
picker.setOnWheelListener(new TimePicker.OnWheelListener() { | ||
@Override | ||
public void onHourWheeled(int index, String hour) { | ||
textView.setText(hour + ":" + picker.getSelectedMinute()); | ||
} | ||
|
||
@Override | ||
public void onMinuteWheeled(int index, String minute) { | ||
textView.setText(picker.getSelectedHour() + ":" + minute); | ||
} | ||
}); | ||
ViewGroup viewGroup = (ViewGroup) findViewById(R.id.wheelview_container); | ||
viewGroup.addView(picker.getContentView()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
android:padding="10dp"> | ||
|
||
<TextView | ||
android:id="@+id/wheelview_tips" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:text="@string/app_name"/> | ||
|
||
<cn.qqtheme.framework.widget.WheelView | ||
android:id="@+id/wheelview_single" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"/> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="1dp" | ||
android:layout_margin="5dp" | ||
android:background="#cccccc"/> | ||
|
||
<LinearLayout | ||
android:id="@+id/wheelview_container" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"/> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.