本文整理匯總了Java中org.androidannotations.annotations.AfterViews類的典型用法代碼示例。如果您正苦於以下問題:Java AfterViews類的具體用法?Java AfterViews怎麽用?Java AfterViews使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AfterViews類屬於org.androidannotations.annotations包,在下文中一共展示了AfterViews類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: bindLvData
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
public void bindLvData(){
moduleBeans=DataUtils.getAdapterData();
if(mAdapter==null) {
mAdapter = new QuickAdapter<ModuleBean>(this, R.layout.lv_item_base_layout,moduleBeans) {
@Override
protected void convert(BaseAdapterHelper helper, ModuleBean item) {
//列表底下顯示進度
mAdapter.showIndeterminateProgress(true);
helper.setText(R.id.text_lv_item_title, item.getModulename())
.setText(R.id.text_lv_item_description, item.getDescription());
//setImageUrl(R.id.img_lv_item, item.getImgurl());
//使用ImageLoader進行加載圖片
ImageView loader_img=helper.getView(R.id.img_lv_item);
listener=ImageLoader.getImageListener(loader_img,R.drawable.ic_loading,R.drawable.ic_loading);
imageLoader.get(item.getImgurl(),listener);
}
};
lv_base_adapter.setAdapter(mAdapter);
}
}
示例2: bindLvData
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
public void bindLvData(){
moduleBeans=DataUtils.getAdapterData();
if(mAdapter==null) {
mAdapter = new QuickAdapter<ModuleBean>(this, R.layout.lv_item_base_layout,moduleBeans) {
@Override
protected void convert(BaseAdapterHelper helper, ModuleBean item) {
//列表底下顯示進度
mAdapter.showIndeterminateProgress(true);
helper.setText(R.id.text_lv_item_title, item.getModulename())
.setText(R.id.text_lv_item_description, item.getDescription())
.setImageUrl(R.id.img_lv_item, item.getImgurl());
}
};
lv_base_adapter.setAdapter(mAdapter);
}
}
示例3: initViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
protected void initViews() {
setTitle(R.string.load_more_title);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//初始化adapter
adapter = new BaseItemAdapter();
//為XXBean數據源注冊XXManager管理類
adapter.register(TextBean.class, new TextViewManager());
adapter.addHeadItem(new TextBean("我是Head View"));
adapter.addFootItem(new TextBean("我是Foot View"));
recyclerView.setAdapter(adapter);
//開啟加載更多視圖
adapter.enableLoadMore(new LoadMoreHolderManager(this::loadData));
//下拉刷新視圖,此處采用SwipeRefreshLayout
swipeRefreshLayout.setOnRefreshListener(() -> refresh());
refresh();
}
示例4: initViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
protected void initViews() {
setTitle(R.string.data_bind_title);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//初始化adapter
BaseItemAdapter adapter = new BaseItemAdapter();
//綁定寫法一(簡單):直接傳入BR.itemData(VariableId)
adapter.register(TextBean.class, new DataBindViewHolderManager<>(R.layout.item_text_data_bind, BR.itemData));
//綁定寫法二(自由):傳入ItemBindView接口實例,可以定製綁定業務邏輯
adapter.register(ImageTextBean.class, new DataBindViewHolderManager<>(
R.layout.item_image_text_data_bind, this::onBindViewHolder));
recyclerView.setAdapter(adapter);
List<Object> list = new ArrayList<>();
for (int i = 0; i < 20; i++) {
list.add(new TextBean("AAA" + i));
list.add(new ImageTextBean("img2", "BBB" + i));
}
adapter.setDataItems(list);
}
示例5: initViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
protected void initViews() {
setTitle(R.string.chat_title);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//初始化adapter
BaseItemAdapter adapter = new BaseItemAdapter();
//為XXBean數據源注冊XXManager管理類組合
adapter.register(MessageBean.class, new ViewHolderManagerGroup<MessageBean>(new SendMessageManager(), new ReceiveMessageManager()) {
@Override
public int getViewHolderManagerIndex(MessageBean itemData) {
//根據message判斷是否本人發送並返回對應ViewHolderManager的index值
return itemData.getSender().equals(UID) ? 0 : 1;
}
});
recyclerView.setAdapter(adapter);
List<MessageBean> list = new ArrayList<>();
list.add(new MessageBean("在嗎?", OTHER));
list.add(new MessageBean("在啊啊啊啊啊啊啊!", UID));
list.add(new MessageBean("目前展示的是聊天界麵中一個消息對應兩種布局的情況,看看效果如何?", OTHER));
list.add(new MessageBean("不錯!", UID));
adapter.setDataItems(list);
}
示例6: initViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
protected void initViews() {
setTitle(R.string.input_title);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//初始化adapter
adapter = new InputItemAdapter();
recyclerView.setAdapter(adapter);
List<Object> list = new ArrayList<>();
//姓名和性別錄入Item,一個錄入item對應多個提交的值{"name":"","sex":""}
list.add(new ItemNameAndSex());
//正常的EditText錄入Item
list.add(new ItemEdit("height").setName("身高:"));
list.add(new ItemEdit("weight").setName("體重:"));
list.add(new ItemEdit("age").setName("年齡:"));
list.add(new ItemEdit("default").setName("國家:").setDefValue("中國"));
//利用DataBinding的錄入Item
list.add(new ItemInfoDataBind("info").setName("介紹:"));
//添加user id對應的隱藏域的Item(用戶不可見)
adapter.addHiddenItem("id", "隱藏域中攜帶id");
adapter.setDataItems(list);
}
示例7: initViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
protected void initViews() {
setTitle(R.string.empty_error_title);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//初始化adapter
BaseItemAdapter adapter = new BaseItemAdapter();
//為XXBean數據源注冊XXManager管理類
adapter.register(TextBean.class, new TextViewManager());
recyclerView.setAdapter(adapter);
adapter.addDataItem(new TextBean("展示空白頁"));
adapter.addDataItem(new TextBean("展示錯誤頁"));
//設置點擊監聽,再點擊Item的時候展示空白或者錯誤頁麵
setOnItemClickListener(adapter);
//初始化空白頁輔助類
emptyViewHelper = newStateViewHelper("列表數據為空");
//初始化錯誤頁輔助類
errorViewHelper = newStateViewHelper("數據加載錯誤");
}
示例8: initViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
protected void initViews() {
setTitle(R.string.animation_title);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//初始化adapter
adapter = new BaseItemAdapter();
//為XXBean數據源注冊XXManager管理類
adapter.register(ImageTextBean.class, new ImageAndTextManager());
recyclerView.setAdapter(adapter);
List<Object> list = new ArrayList<>();
for (int i = 0; i < 20; i++) {
list.add(new ImageTextBean(R.drawable.img2, "BBB" + i));
}
adapter.setDataItems(list);
}
示例9: initViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
protected void initViews() {
setTitle(R.string.multi_item_title);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//初始化adapter
BaseItemAdapter adapter = new BaseItemAdapter();
//為XXBean數據源注冊XXManager管理類
adapter.register(TextBean.class, new TextViewManager());
adapter.register(ImageTextBean.class, new ImageAndTextManager());
adapter.register(ImageBean.class, new ImageViewManager());
recyclerView.setAdapter(adapter);
List<Object> list = new ArrayList<>();
for (int i = 0; i < 20; i++) {
list.add(new TextBean("AAA" + i));
list.add(new ImageBean(R.drawable.img1));
list.add(new ImageTextBean(R.drawable.img2, "BBB" + i));
}
adapter.setDataItems(list);
}
示例10: initViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
protected void initViews() {
setTitle(R.string.user_info_title);
UserBean userBean = getUserBean();
recyclerView.setLayoutManager(new LinearLayoutManager(this));
//初始化adapter
BaseItemAdapter adapter = new BaseItemAdapter();
//為UserBean數據源注冊數據綁定View Holder Manager管理類
adapter.register(ItemInfo.class, new DataBindViewHolderManager<>(
R.layout.item_info, BR.itemData));
recyclerView.setAdapter(adapter);
//構建用戶信息需要展示的ItemInfo的集合,每個ItemInfo代表頁麵中的一行
List<ItemInfo> list = new ArrayList<>(5);
list.add(new ItemInfo("名字", userBean.getName()));
list.add(new ItemInfo("性別", userBean.getSex()));
list.add(new ItemInfo("年齡", userBean.getAge()));
list.add(new ItemInfo("城市", userBean.getAddr()));
list.add(new ItemInfo("介紹", userBean.getInfo()));
adapter.setDataItems(list);
}
示例11: afterViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
void afterViews(){
setToolbar("레크레크", 0, R.drawable.ic_menu_white_24dp, R.drawable.ic_note_add_white_24dp, 0);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(ActivityMain.this, ActivityRecordVoice_.class));
}
});
navigationView.setNavigationItemSelectedListener(this);
if(adapter == null)
return;
setupRecyclerView();
super.setupSwipeRefreshLayout();
loadData(0);
}
示例12: beginOAuth
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
protected void beginOAuth() {
URL authUrl = this.helper.getAuthorizationUrl(this.credentials, true, true, this.scopes);
this.webviewLogin.loadUrl(authUrl.toExternalForm());
this.webviewLogin.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
if (url.contains("code=")) {
LoginActivity.this.handleOAuthSuccess(url);
} else if (url.contains("error=")) {
LoginActivity.this.handleOAuthError(url);
}
}
});
}
示例13: visitUrl
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
@SuppressLint("SetJavaScriptEnabled")
protected void visitUrl() {
this.webview.setWebChromeClient(new WebChromeClient());
// the default webview client will occasionally open the browser
// we don't want this - we want content to be displayed,
// by default, in the app.
this.webview.setWebViewClient(new WebViewClient());
// allow js
WebSettings settings = this.webview.getSettings();
// attempt to initially fit content without requiring zooms
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
// allow zooming
settings.setBuiltInZoomControls(true);
// allow js
settings.setJavaScriptEnabled(true);
this.webview.loadUrl(this.url);
}
示例14: setUpViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
void setUpViews() {
ThemeColorManager.addActivityStatusBar(this);
setUpToolbar();
initMenuItem();
setUpEditor();
}
示例15: setUpViews
import org.androidannotations.annotations.AfterViews; //導入依賴的package包/類
@AfterViews
void setUpViews() {
setUpToolbar();
setUpTabViewPager();
setUpDrawerHeader();
setUpFragment();
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
registerBackPressHandlers();
}