本文整理汇总了Java中com.example.retrofit.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.example.retrofit包,在下文中一共展示了R类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import com.example.retrofit.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_rx_all:
Intent intentC = new Intent(this, CombinApiActivity.class);
startActivity(intentC);
break;
case R.id.btn_rx:
manager.doHttpDeal(postEntity);
break;
case R.id.btn_rx_uploade:
manager.doHttpDeal(uplaodApi);
break;
case R.id.btn_rx_mu_down:
Intent intent = new Intent(this, DownLaodActivity.class);
startActivity(intent);
break;
}
}
示例2: onClick
import com.example.retrofit.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_simple:
onButton9Click();
break;
case R.id.btn_rx:
simpleDo();
break;
case R.id.btn_rx_uploade:
uploadeDo();
break;
case R.id.btn_rx_mu_down:
Intent intent=new Intent(this,DownLaodActivity.class);
startActivity(intent);
break;
}
}
示例3: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvMsg = (TextView) findViewById(R.id.tv_msg);
findViewById(R.id.btn_rx).setOnClickListener(this);
findViewById(R.id.btn_rx_mu_down).setOnClickListener(this);
findViewById(R.id.btn_rx_uploade).setOnClickListener(this);
img = (ImageView) findViewById(R.id.img);
progressBar = (NumberProgressBar) findViewById(R.id.number_progress_bar);
/*初始化数据*/
manager = new HttpManager(this, this);
postEntity = new SubjectPostApi();
postEntity.setAll(true);
/*上传接口内部接口有token验证,所以需要换成自己的接口测试,检查file文件是否手机存在*/
uplaodApi = new UploadApi();
File file = new File("/storage/emulated/0/Download/11.jpg");
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpeg"), file);
MultipartBody.Part part = MultipartBody.Part.createFormData("file_name", file.getName(), new ProgressRequestBody
(requestBody,
new UploadProgressListener() {
@Override
public void onProgress(long currentBytesCount, long totalBytesCount) {
tvMsg.setText("提示:上传中");
progressBar.setMax((int) totalBytesCount);
progressBar.setProgress((int) currentBytesCount);
}
}));
uplaodApi.setPart(part);
}
示例4: onClick
import com.example.retrofit.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_rx:
manager.doHttpDeal(postEntity);
break;
case R.id.btn_rx_uploade:
manager.doHttpDeal(uplaodApi);
break;
case R.id.btn_rx_mu_down:
Intent intent = new Intent(this, DownLaodActivity.class);
startActivity(intent);
break;
}
}
示例5: DownHolder
import com.example.retrofit.R; //导入依赖的package包/类
public DownHolder(ViewGroup parent) {
super(parent, R.layout.view_item_holder);
manager= HttpDownManager.getInstance();
$(R.id.btn_rx_down).setOnClickListener(this);
$(R.id.btn_rx_pause).setOnClickListener(this);
progressBar=$(R.id.number_progress_bar);
tvMsg=$(R.id.tv_msg);
}
示例6: onClick
import com.example.retrofit.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_rx_down:
if(apkApi.getState()!= DownState.FINISH){
manager.startDown(apkApi);
}
break;
case R.id.btn_rx_pause:
manager.pause(apkApi);
break;
}
}
示例7: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_down_laod);
initResource();
initWidget();
}
示例8: initWidget
import com.example.retrofit.R; //导入依赖的package包/类
private void initWidget(){
EasyRecyclerView recyclerView=(EasyRecyclerView)findViewById(R.id.rv);
DownAdapter adapter=new DownAdapter(this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
adapter.addAll(listData);
}
示例9: initWidget
import com.example.retrofit.R; //导入依赖的package包/类
private void initWidget() {
EasyRecyclerView recyclerView = (EasyRecyclerView) findViewById(R.id.rv);
DownAdapter adapter = new DownAdapter(this);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
adapter.addAll(listData);
}
示例10: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvMsg = (TextView) findViewById(R.id.tv_msg);
findViewById(R.id.btn_simple).setOnClickListener(this);
findViewById(R.id.btn_rx).setOnClickListener(this);
findViewById(R.id.btn_rx_mu_down).setOnClickListener(this);
findViewById(R.id.btn_rx_uploade).setOnClickListener(this);
img=(ImageView)findViewById(R.id.img);
progressBar=(NumberProgressBar)findViewById(R.id.number_progress_bar);
}
示例11: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mvp);
ButterKnife.bind(this);
plistener = new P(this);
}
示例12: onCreate
import com.example.retrofit.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvMsg = (TextView) findViewById(R.id.tv_msg);
findViewById(R.id.btn_rx).setOnClickListener(this);
findViewById(R.id.btn_rx_all).setOnClickListener(this);
findViewById(R.id.btn_rx_mu_down).setOnClickListener(this);
findViewById(R.id.btn_rx_uploade).setOnClickListener(this);
img = (ImageView) findViewById(R.id.img);
progressBar = (NumberProgressBar) findViewById(R.id.number_progress_bar);
/*初始化数据*/
manager = new HttpManager(this, this);
postEntity = new SubjectPostApi();
postEntity.setAll(true);
/*上传接口内部接口有token验证,所以需要换成自己的接口测试,检查file文件是否手机存在*/
uplaodApi = new UploadApi();
File file = new File("/storage/emulated/0/Download/11.jpg");
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpeg"), file);
MultipartBody.Part part = MultipartBody.Part.createFormData("file_name", file.getName(), new ProgressRequestBody
(requestBody, new UploadProgressListener() {
@Override
public void onProgress(final long currentBytesCount, final long totalBytesCount) {
/*回到主线程中,可通过timer等延迟或者循环避免快速刷新数据*/
Observable.just(currentBytesCount).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<Long>() {
@Override
public void call(Long aLong) {
tvMsg.setText("提示:上传中");
progressBar.setMax((int) totalBytesCount);
progressBar.setProgress((int) currentBytesCount);
}
});
}
}));
uplaodApi.setPart(part);
}
示例13: onTvTestClick
import com.example.retrofit.R; //导入依赖的package包/类
@OnClick(value = R.id.tv_test)
void onTvTestClick(View view) {
plistener.doTest("1");
}
示例14: onTvMsgClick
import com.example.retrofit.R; //导入依赖的package包/类
@OnClick(value = R.id.tv_msg)
void onTvMsgClick(View view) {
SubjectPostApi postEntity = new SubjectPostApi();
postEntity.setAll(true);
plistener.startPost(MvpActivity.this, postEntity);
}