Search in sources :

Example 1 with ProgressChartView

use of com.wuzhanglao.niubi.widget.ProgressChartView in project Notes by Elder-Wu.

the class IosBottomDialogFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.fragment_bottom_dialog, container, false);
    rootView.findViewById(R.id.fragment_ios_bottom_dialog_btn1).setOnClickListener(this);
    rootView.findViewById(R.id.fragment_ios_bottom_dialog_btn2).setOnClickListener(this);
    rootView.findViewById(R.id.fragment_ios_bottom_dialog_btn3).setOnClickListener(this);
    rootView.findViewById(R.id.fragment_ios_bottom_dialog_btn4).setOnClickListener(this);
    rootView.findViewById(R.id.fragment_ios_bottom_dialog_btn5).setOnClickListener(this);
    rootView.findViewById(R.id.fragment_ios_bottom_dialog_btn6).setOnClickListener(this);
    String str1 = "Hello Shanbay";
    String str2 = ";a sh  *if iao;h";
    String str3 = "Hahahah ** he hei xi xiixi";
    String str4 = "**as;higoan* e;v**se;viauhfid*";
    handle(str1);
    handle(str2);
    handle(str3);
    handle(str4);
    Observable.timer(5, TimeUnit.SECONDS).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Long>() {

        @Override
        public void call(Long aLong) {
            TextView textView = (TextView) rootView.findViewById(R.id.xxxx);
            textView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
            AppUtils.showToast("ζˆεŠŸδΊ†");
        }
    });
    final ProgressChartView chartView = (ProgressChartView) rootView.findViewById(R.id.chart);
    ArrayList<ProgressChartView.Data> mRawDataList = new ArrayList<>();
    mRawDataList.add(new ProgressChartView.Data("Mar 01", 3111));
    //		mRawDataList.add(new Data("Mar 02", 0));
    //		mRawDataList.add(new Data("Mar 03", 0));
    //		mRawDataList.add(new Data("Mar 04", 0));
    //		mRawDataList.add(new Data("Mar 05", 0));
    //		mRawDataList.add(new Data("Mar 06", 0));
    //		mRawDataList.add(new Data("Mar 07", 0));
    mRawDataList.add(new ProgressChartView.Data("Mar 02", 3115));
    mRawDataList.add(new ProgressChartView.Data("Mar 03", 3278));
    mRawDataList.add(new ProgressChartView.Data("Mar 04", 3376));
    mRawDataList.add(new ProgressChartView.Data("Mar 05", 3489));
    mRawDataList.add(new ProgressChartView.Data("Mar 06", 3789));
    mRawDataList.add(new ProgressChartView.Data("Mar 07", 3788));
    chartView.setData(mRawDataList);
    chartView.setColor(Color.RED);
    SwitchCompat switchCompat = (SwitchCompat) rootView.findViewById(R.id.switch_btn);
    switchCompat.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                chartView.showAllHintView();
            } else {
                chartView.removeAllHintView();
            }
        }
    });
    return rootView;
}
Also used : ArrayList(java.util.ArrayList) TextView(android.widget.TextView) ProgressChartView(com.wuzhanglao.niubi.widget.ProgressChartView) View(android.view.View) ProgressChartView(com.wuzhanglao.niubi.widget.ProgressChartView) TextView(android.widget.TextView) CompoundButton(android.widget.CompoundButton) SwitchCompat(android.support.v7.widget.SwitchCompat) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)1 SwitchCompat (android.support.v7.widget.SwitchCompat)1 View (android.view.View)1 CompoundButton (android.widget.CompoundButton)1 TextView (android.widget.TextView)1 ProgressChartView (com.wuzhanglao.niubi.widget.ProgressChartView)1 ArrayList (java.util.ArrayList)1