当前位置: 首页>>代码示例>>Java>>正文


Java AfterViews类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:VolleyLoaderActivity.java

示例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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:BaseAdapterTestActivity.java

示例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();
}
 
开发者ID:free46000,项目名称:MultiItem,代码行数:19,代码来源:LoadMoreActivity.java

示例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);
}
 
开发者ID:free46000,项目名称:MultiItem,代码行数:22,代码来源:DataBindActivity.java

示例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);
}
 
开发者ID:free46000,项目名称:MultiItem,代码行数:25,代码来源:ChatActivity.java

示例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);
}
 
开发者ID:free46000,项目名称:MultiItem,代码行数:23,代码来源:InputActivity.java

示例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("数据加载错误");
}
 
开发者ID:free46000,项目名称:MultiItem,代码行数:19,代码来源:EmptyAndErrorActivity.java

示例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);
}
 
开发者ID:free46000,项目名称:MultiItem,代码行数:18,代码来源:AnimationActivity.java

示例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);
}
 
开发者ID:free46000,项目名称:MultiItem,代码行数:22,代码来源:MultiItemActivity.java

示例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);
}
 
开发者ID:free46000,项目名称:MultiItem,代码行数:24,代码来源:UserInfoActivity.java

示例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);
}
 
开发者ID:lecrec,项目名称:lecrec-android,代码行数:23,代码来源:ActivityMain.java

示例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);
            }
        }
    });
}
 
开发者ID:AlbinoDrought,项目名称:party-reader,代码行数:17,代码来源:LoginActivity.java

示例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);
}
 
开发者ID:AlbinoDrought,项目名称:party-reader,代码行数:26,代码来源:ExternalWebResourceActivity.java

示例14: setUpViews

import org.androidannotations.annotations.AfterViews; //导入依赖的package包/类
@AfterViews
void setUpViews() {
    ThemeColorManager.addActivityStatusBar(this);
    setUpToolbar();
    initMenuItem();
    setUpEditor();
}
 
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:8,代码来源:EditActivity.java

示例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();
}
 
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:10,代码来源:MainActivity.java


注:本文中的org.androidannotations.annotations.AfterViews类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。