Skip to content

Commit

Permalink
update RxDemo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamsiree committed Mar 10, 2020
1 parent 18bd7bf commit 0e5eaa6
Show file tree
Hide file tree
Showing 44 changed files with 1,207 additions and 918 deletions.
1 change: 1 addition & 0 deletions RxDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dependencies {
implementation project(':RxPay')
implementation project(':RxCamera')
implementation project(':RxFeature')
implementation project(':RxArcGisKit')


//cardView包
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
package com.tamsiree.rxdemo.activity;

import android.os.Bundle;
import android.widget.RelativeLayout;

import com.tamsiree.rxdemo.R;
import com.tamsiree.rxkit.RxBarTool;
import com.tamsiree.rxkit.RxDeviceTool;
import com.tamsiree.rxui.activity.ActivityBase;
import com.tamsiree.rxui.view.RxTitle;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
* @author tamsiree
*/
public class ActivityAutoImageView extends ActivityBase {

@BindView(R.id.rx_title)
RxTitle mRxTitle;
@BindView(R.id.activity_auto_image_view)
RelativeLayout mActivityAutoImageView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RxBarTool.noTitle(this);
RxBarTool.setTransparentStatusBar(this);
setContentView(R.layout.activity_auto_image_view);
ButterKnife.bind(this);
RxDeviceTool.setPortrait(this);

mRxTitle.setLeftFinish(mContext);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import android.view.View;
import android.widget.LinearLayout;

import androidx.appcompat.app.AppCompatActivity;

import com.tamsiree.rxdemo.R;
import com.tamsiree.rxdemo.adapter.AdapterStackTest;
import com.tamsiree.rxkit.RxDeviceTool;
import com.tamsiree.rxkit.RxTool;
import com.tamsiree.rxkit.interfaces.OnSimpleListener;
import com.tamsiree.rxui.activity.ActivityBase;
import com.tamsiree.rxui.view.RxTitle;
import com.tamsiree.rxui.view.cardstack.RxCardStackView;
import com.tamsiree.rxui.view.cardstack.tools.RxAdapterAllMoveDownAnimator;
import com.tamsiree.rxui.view.cardstack.tools.RxAdapterUpDownAnimator;
Expand All @@ -26,7 +26,7 @@
/**
* @author tamsiree
*/
public class ActivityCardStack extends AppCompatActivity implements RxCardStackView.ItemExpendListener {
public class ActivityCardStack extends ActivityBase implements RxCardStackView.ItemExpendListener {

public static Integer[] TEST_DATAS = new Integer[]{
R.color.custom_progress_green_header,
Expand Down Expand Up @@ -60,6 +60,10 @@ public class ActivityCardStack extends AppCompatActivity implements RxCardStackV
RxCardStackView mStackView;
@BindView(R.id.button_container)
LinearLayout mButtonContainer;
@BindView(R.id.rx_title)
RxTitle mRxTitle;
@BindView(R.id.activity_card_stack)
LinearLayout mActivityCardStack;
private AdapterStackTest mTestStackAdapter;

@Override
Expand All @@ -68,6 +72,9 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_card_stack);
ButterKnife.bind(this);
RxDeviceTool.setPortrait(this);

mRxTitle.setLeftFinish(this);

mStackView.setItemExpendListener(this);
mTestStackAdapter = new AdapterStackTest(this);
mStackView.setAdapter(mTestStackAdapter);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.tamsiree.rxdemo.activity;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
Expand All @@ -8,17 +9,19 @@
import android.widget.ProgressBar;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.tamsiree.rxdemo.R;
import com.tamsiree.rxkit.RxBarTool;
import com.tamsiree.rxkit.RxDataTool;
import com.tamsiree.rxkit.RxDeviceTool;
import com.tamsiree.rxui.activity.ActivityBase;
import com.tamsiree.rxui.view.RxArcProgress;
import com.tamsiree.rxui.view.RxProgressBar;
import com.tamsiree.rxui.view.RxRoundProgress;
import com.tamsiree.rxui.view.RxTitle;
import com.tamsiree.rxui.view.roundprogressbar.RxIconRoundProgressBar;
import com.tamsiree.rxui.view.roundprogressbar.RxRoundProgressBar;
import com.tamsiree.rxui.view.roundprogressbar.RxTextRoundProgressBar;
import com.tamsiree.rxui.view.roundprogressbar.RxIconRoundProgress;
import com.tamsiree.rxui.view.roundprogressbar.RxRoundProgress;
import com.tamsiree.rxui.view.roundprogressbar.RxTextRoundProgress;

import butterknife.BindView;
import butterknife.ButterKnife;
Expand All @@ -27,89 +30,94 @@
/**
* @author tamsiree
*/
@SuppressLint("HandlerLeak")
public class ActivityProgressBar extends ActivityBase {


double money = 1000;
Thread downLoadThread;
Thread downLoadThread1;
Thread downLoadThread2;
Thread downLoadRxRoundPdThread;


Handler handler = new Handler() {

@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
mFlikerbar.setProgress(msg.arg1);
mRoundFlikerbar.setProgress(msg.arg1);
if (msg.arg1 == 100) {
mFlikerbar.finishLoad();
mRoundFlikerbar.finishLoad();
}
}
};
@BindView(R.id.rx_title)
RxTitle mRxTitle;
@BindView(R.id.flikerbar)
RxProgressBar mFlikerbar;
@BindView(R.id.round_flikerbar)
RxProgressBar mRoundFlikerbar;
@BindView(R.id.rx_round_pd1)
RxRoundProgressBar mRxRoundPd1;
RxRoundProgress mRxRoundPd1;
@BindView(R.id.rx_round_pd2)
RxRoundProgressBar mRxRoundPd2;
RxRoundProgress mRxRoundPd2;
@BindView(R.id.rx_round_pd3)
RxRoundProgressBar mRxRoundPd3;
RxRoundProgress mRxRoundPd3;
@BindView(R.id.rx_round_pd4)
RxRoundProgressBar mRxRoundPd4;
RxRoundProgress mRxRoundPd4;
@BindView(R.id.rx_round_pd5)
RxRoundProgressBar mRxRoundPd5;
RxRoundProgress mRxRoundPd5;
@BindView(R.id.rx_round_pd6)
RxRoundProgressBar mRxRoundPd6;
RxRoundProgress mRxRoundPd6;
@BindView(R.id.rx_round_pd7)
RxRoundProgressBar mRxRoundPd7;
RxRoundProgress mRxRoundPd7;
@BindView(R.id.rx_round_pd8)
RxIconRoundProgressBar mRxRoundPd8;
RxIconRoundProgress mRxRoundPd8;
@BindView(R.id.rx_round_pd9)
RxIconRoundProgressBar mRxRoundPd9;
RxIconRoundProgress mRxRoundPd9;
@BindView(R.id.rx_round_pd10)
RxIconRoundProgressBar mRxRoundPd10;
RxIconRoundProgress mRxRoundPd10;
@BindView(R.id.rx_round_pd11)
RxIconRoundProgressBar mRxRoundPd11;
RxIconRoundProgress mRxRoundPd11;
@BindView(R.id.rx_round_pd12)
RxIconRoundProgressBar mRxRoundPd12;
RxIconRoundProgress mRxRoundPd12;
@BindView(R.id.rx_round_pd13)
RxIconRoundProgressBar mRxRoundPd13;
RxIconRoundProgress mRxRoundPd13;
@BindView(R.id.rx_round_pd14)
RxIconRoundProgressBar mRxRoundPd14;
RxIconRoundProgress mRxRoundPd14;
@BindView(R.id.rx_round_pd15)
RxTextRoundProgressBar mRxRoundPd15;
RxTextRoundProgress mRxRoundPd15;
@BindView(R.id.rx_round_pd16)
RxTextRoundProgressBar mRxRoundPd16;
RxTextRoundProgress mRxRoundPd16;
@BindView(R.id.rx_round_pd17)
RxTextRoundProgressBar mRxRoundPd17;
RxTextRoundProgress mRxRoundPd17;
@BindView(R.id.progress_one)
RxIconRoundProgressBar mProgressOne;
RxIconRoundProgress mProgressOne;
@BindView(R.id.progress_two)
RxRoundProgressBar mProgressTwo;
RxRoundProgress mProgressTwo;
@BindView(R.id.progress_three)
RxTextRoundProgressBar mProgressThree;
RxTextRoundProgress mProgressThree;
@BindView(R.id.textView)
TextView mTextView;
@BindView(R.id.pb_line_of_credit)
ProgressBar mPbLineOfCredit;
@BindView(R.id.textView5)
TextView mTextView5;
@BindView(R.id.roundProgressBar1)
RxRoundProgress mRxRoundProgress1;
RxArcProgress mRoundProgressBar1;
@BindView(R.id.activity_round_progress_bar)
LinearLayout mActivityRoundProgressBar;
double money = 1000;
Thread downLoadThread;
Thread downLoadThread1;
Thread downLoadThread2;
Thread downLoadRxRoundPdThread;
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
mFlikerbar.setProgress(msg.arg1);
mRoundFlikerbar.setProgress(msg.arg1);
if (msg.arg1 == 100) {
mFlikerbar.finishLoad();
mRoundFlikerbar.finishLoad();
}
}
};

private double progress;
private int progress1;
private int money1 = 10000;
private int mRxRoundProgress;
Handler mRxRoundPdHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
mRxRoundPd1.setProgress(mRxRoundProgress);
mRxRoundPd2.setProgress(mRxRoundProgress);
Expand Down Expand Up @@ -176,8 +184,8 @@ private void initRoundProgress() {
// TODO Auto-generated method stub
progress = 0;// 进度初始化

mRxRoundProgress1.setProgress(progress);
mRxRoundProgress1.setMax(getMax(money));
mRoundProgressBar1.setProgress(progress);
mRoundProgressBar1.setMax(getMax(money));

downLoadThread2 = new Thread(new Runnable() {

Expand All @@ -186,30 +194,30 @@ public void run() {

try {
while (!downLoadThread2.isInterrupted()) {
while (progress < mRxRoundProgress1.getMax()) {
progress += mRxRoundProgress1.getMax() * 0.01;
if (progress < mRxRoundProgress1.getMax()) {
mRxRoundProgress1.setProgress(progress);
while (progress < mRoundProgressBar1.getMax()) {
progress += mRoundProgressBar1.getMax() * 0.01;
if (progress < mRoundProgressBar1.getMax()) {
mRoundProgressBar1.setProgress(progress);
}
Thread.sleep(8);
}
while (progress > 0) {
progress -= mRxRoundProgress1.getMax() * 0.01;
progress -= mRoundProgressBar1.getMax() * 0.01;
if (progress > 0) {
mRxRoundProgress1.setProgress(progress);
mRoundProgressBar1.setProgress(progress);
}
Thread.sleep(8);
}

if (money != 0) {
while (progress < money) {
progress += money * 0.01;
mRxRoundProgress1.setProgress(progress);
mRoundProgressBar1.setProgress(progress);
Thread.sleep(10);
}
}

mRxRoundProgress1.setProgress(money);
mRoundProgressBar1.setProgress(money);
}
} catch (InterruptedException e) {
// TODO Auto-generated catch block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void onClick(View view) {
RxToast.normal(mContext, "这是一个普通的没有ICON的Toast").show();
break;
case R.id.button_normal_toast_w_icon:
Drawable icon = getResources().getDrawable(R.drawable.set);
Drawable icon = getResources().getDrawable(R.drawable.clover);
RxToast.normal(mContext, "这是一个普通的包含ICON的Toast", icon).show();
break;
default:
Expand Down
Loading

0 comments on commit 0e5eaa6

Please sign in to comment.