Java 类org.androidannotations.annotations.AfterViews 实例源码

项目:GitHub    文件:BaseAdapterTestActivity.java   
@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);
    }
}
项目:GitHub    文件:VolleyLoaderActivity.java   
@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);
    }
}
项目:MultiItem    文件:LoadMoreActivity.java   
@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();
}
项目:MultiItem    文件:DataBindActivity.java   
@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);
}
项目:MultiItem    文件:ChatActivity.java   
@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);
}
项目:MultiItem    文件:InputActivity.java   
@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);
}
项目:MultiItem    文件:EmptyAndErrorActivity.java   
@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("数据加载错误");
}
项目:MultiItem    文件:AnimationActivity.java   
@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);
}
项目:MultiItem    文件:MultiItemActivity.java   
@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);
}
项目:MultiItem    文件:UserInfoActivity.java   
@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);
}
项目:lecrec-android    文件:ActivityMain.java   
@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);
}
项目:party-reader    文件:LoginActivity.java   
@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);
            }
        }
    });
}
项目:party-reader    文件:ExternalWebResourceActivity.java   
@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);
}
项目:https-github.com-hyb1996-NoRootScriptDroid    文件:EditActivity.java   
@AfterViews
void setUpViews() {
    ThemeColorManager.addActivityStatusBar(this);
    setUpToolbar();
    initMenuItem();
    setUpEditor();
}
项目:https-github.com-hyb1996-NoRootScriptDroid    文件:MainActivity.java   
@AfterViews
void setUpViews() {
    setUpToolbar();
    setUpTabViewPager();
    setUpDrawerHeader();
    setUpFragment();
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
    registerBackPressHandlers();
}
项目:https-github.com-hyb1996-NoRootScriptDroid    文件:TaskManagerFragment.java   
@AfterViews
void setUpViews() {
    init();
    final boolean noRunningScript = mTaskListRecyclerView.getAdapter().getItemCount() == 0;
    mNoRunningScriptNotice.setVisibility(noRunningScript ? View.VISIBLE : View.GONE);
    mCloseAllView.setVisibility(noRunningScript ? View.GONE : View.VISIBLE);
}
项目:https-github.com-hyb1996-NoRootScriptDroid    文件:TaskerScriptEditActivity.java   
@AfterViews
void setUpViews() {
    ((TextView) findViewById(R.id.summary)).setText(mSummary);
    ThemeColorManager.addActivityStatusBar(this);
    BaseActivity.setToolbarAsBack(this, R.id.toolbar, mTitle);
    setUpEditor();
}
项目:GitHub    文件:MainInfoFragment.java   
@AfterViews
public void initDatas(){
    fragments=new ArrayList<>();
    fragments.add(new OneFragment());
    fragments.add(new TwoFragment());
    fragments.add(new ThreeFragment());
    fragments.add(new FourFragment());

    mPagerAdater=new FixedPagerAdapter(getChildFragmentManager());
    mPagerAdater.setFragments(fragments);
    info_viewpager.setAdapter(mPagerAdater);
    id_indicator.setViewPager(info_viewpager,0);
}
项目:GitHub    文件:RecyclerViewAAActivity.java   
@AfterViews
public void initViews(){
    top_bar_title.setText("RecyclerView集合AA注入框架实例");
    //进行设置RecyerView ,并且绑定数据
    LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this);
    linearLayoutManager.setOrientation(OrientationHelper.VERTICAL);
    aa_recyclerview.setLayoutManager(linearLayoutManager);
    adapter.setItems(userFinder.findAll());
    aa_recyclerview.setAdapter(adapter);
}
项目:TextEmoji    文件:TabView.java   
@AfterViews
@UiThread
void init() {
    mItemName.setText(mName);
    mItemIcon.setImageResource(mNormal);
    mInited = true;
    setSelected(mIsSelected);
}
项目:NodeET    文件:TopicListFragment.java   
@AfterViews
void setUpViews() {
    mSwipeRefreshLayout.setOnRefreshListener(this::fetchTopics);
    mTopicListRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    mTopicListRecyclerView.setAdapter(mTopicListAdapter);
    mTopicListRecyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getContext())
            .colorResId(R.color.color_topic_list_divider)
            .sizeResId(R.dimen.size_topic_list_divider)
            .build());
    fetchTopics();
}
项目:TYT    文件:ModifyPasswordActivity.java   
@AfterViews
public void onAfterViews() {
    mRequestQueue = Volley.newRequestQueue(this);
    userInfoSp = MyApplication.getInstance().getUserInfoSp();
    loginPassword = userInfoSp.getString(AppDelegate.PASSWORD, "");
    initToolbar();
    initEditText();
    tv_lgName.setText("用户登录名:" + userInfoSp.getString(AppDelegate.LG_NAME, ""));
    tv_platformName.setText("登录平台名:" + MyApplication_.getInstance().getPlatFormString());
}
项目:TYT    文件:T_MyInvoiceActivity.java   
@AfterViews
public void onAfterViews() {
    initToolbar();
    showView(mProgressbar);

    if (mViewPager != null) {
        TableLayoutAdapter mAdapter = new TableLayoutAdapter(getSupportFragmentManager());
        mAdapter.addFragment(new T_MyInvoice_InvoiceNoticeFragment_(), getStrings(R.string.invoice_notice));
        mAdapter.addFragment(new T_MyInvoice_InvoiceInformationFragment_(), getStrings(R.string.invoice_information));
        mViewPager.setAdapter(mAdapter);
        mTabLayout.setupWithViewPager(mViewPager);
    }

    hideView(mProgressbar);
}
项目:TYT    文件:T_CustomerServiceActivity.java   
@AfterViews
public void onAfterViews() {
    initToolbar();
    mRequestQueue = Volley.newRequestQueue(this);
    userInfoSp = MyApplication_.getInstance().getUserInfoSp();
    showView(mProgressbar);
    hideView(mCardView);
    onBackgrounds();
}
项目:AndroidVideoCache    文件:GalleryVideoFragment.java   
@AfterViews
void afterViewInjected() {
    startProxy();

    if (visibleForUser) {
        startPlayer();
    }
}
项目:lockit    文件:PasswordFragment.java   
@AfterViews
void registerEvents() {
    passwordView.numKey.subscribe(i -> numKeySelected());
    passwordView.backKey.subscribe(i -> backKeyPressed());
    passwordView.deleteKey.subscribe(i -> deleteKeyPressed());
    passwordView.fourKeyEntered.subscribe((code) -> {
        new Handler().postDelayed(() -> codeEntered(code), 200);
    });
}
项目:lockit    文件:LockView.java   
@AfterViews
void registerEvents() {
    passwordView.numKey.subscribe(i -> numKeySelected());
    passwordView.backKey.subscribe(i -> backKeyPress.onNext(null));
    passwordView.deleteKey.subscribe(i -> deleteKeyPressed());
    passwordView.fourKeyEntered.subscribe((code) -> {
        new Handler().postDelayed(() -> codeEntered(code), 200);
    });
}
项目:lockit    文件:HomeActivity.java   
@AfterViews
void setupNavigationView() {
    mDrawerToggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.app_name, R.string.app_name);
    mDrawerToggle.setDrawerIndicatorEnabled(true);
    drawer.setDrawerListener(mDrawerToggle);
    navigation.setNavigationItemSelectedListener(this::navigationItemSelected);
    navigation.getMenu().getItem(0).setChecked(true);
}
项目:lockit    文件:FourPinView.java   
@AfterViews
void init() {
    pin[0] = pin1;
    pin[1] = pin2;
    pin[2] = pin3;
    pin[3] = pin4;
}
项目:Auto.js    文件:EditorView.java   
@AfterViews
void init() {
    setUpEditor();
    setUpInputMethodEnhancedBar();
    setUpFunctionsKeyboard();
    setMenuItemStatus(R.id.save, false);
    mDocsWebView.getWebView().getSettings().setDisplayZoomControls(true);
    mDocsWebView.getWebView().loadUrl(Pref.getDocumentationUrl() + "index.html");

}
项目:Auto.js    文件:DrawerFragment.java   
@AfterViews
void setUpViews() {
    ThemeColorManager.addViewBackground(mHeaderView);
    initMenuItems();
    if (Pref.isFloatingMenuShown()) {
        setChecked(mFloatingWindowItem, true);
    }
    setChecked(mConnectionItem, DevPluginService.getInstance().isConnected());
}
项目:Auto.js    文件:CommunityFragment.java   
@AfterViews
void setUpViews() {
    mWebView = mEWebView.getWebView();
    String url = "http://www.autojs.org/";
    Bundle savedWebViewState = getArguments().getBundle("savedWebViewState");
    if (savedWebViewState != null) {
        mWebView.restoreState(savedWebViewState);
    } else {
        mWebView.loadUrl(url);
    }
}
项目:Auto.js    文件:MainActivity.java   
@AfterViews
void setUpViews() {
    setUpToolbar();
    setUpTabViewPager();
    getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
    registerBackPressHandlers();
    ThemeColorManager.addViewBackground(findViewById(R.id.app_bar));
}
项目:Auto.js    文件:MyScriptListFragment.java   
@AfterViews
void setUpViews() {
    ScriptList.SortConfig sortConfig = ScriptList.SortConfig.from(PreferenceManager.getDefaultSharedPreferences(getContext()));
    mScriptFileList.setSortConfig(sortConfig);
    mScriptFileList.setStorageFileProvider(StorageFileProvider.getDefault());
    mScriptFileList.setOnScriptFileClickListener((view, file) -> Scripts.edit(file));
}
项目:Auto.js    文件:TimedTaskSettingActivity.java   
@AfterViews
void setupViews() {
    setToolbarAsBack(getString(R.string.text_timed_task));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        mToolbar.setSubtitle(mScriptFile.getName());
    }
    findDayOfWeekCheckBoxes(mWeeklyTaskContainer);
    setUpTime();
}
项目:SSHFileManager    文件:SSHServersFragment.java   
@AfterViews
void initThis() {
    adapter = new SSHServersListAdapter(this.getContext(), sshServers, this);
    sshServersList.setAdapter(adapter);
    floatingActionButton.setImageDrawable(new IconicsDrawable(this.getContext()).icon(GoogleMaterial.Icon.gmd_add).colorRes(R.color.colorFloatIcon).sizeDp(48));
    refresh();
}
项目:Auto.js    文件:DocumentationActivity.java   
@AfterViews
void setUpViews() {
    setToolbarAsBack(getString(R.string.text_tutorial));
    mWebView = mEWebView.getWebView();
    String url = getIntent().getStringExtra(EXTRA_URL);
    if (url == null) {
        url = Pref.getDocumentationUrl() + "index.html";
    }
    mWebView.loadUrl(url);
}
项目:Auto.js    文件:DocsFragment.java   
@AfterViews
void setUpViews() {
    mWebView = mEWebView.getWebView();
    String url = Pref.getDocumentationUrl() + "index.html";
    Bundle savedWebViewState = getArguments().getBundle("savedWebViewState");
    if (savedWebViewState != null) {
        mWebView.restoreState(savedWebViewState);
    } else {
        mWebView.loadUrl(getArguments().getString(ARGUMENT_URL, url));
    }
}
项目:Auto.js    文件:TaskerScriptEditActivity.java   
@AfterViews
void setUpViews() {
    mEditorView.handleIntent(getIntent()
            .putExtra(EXTRA_RUN_ENABLED, false)
            .putExtra(EXTRA_SAVE_ENABLED, false));
    BaseActivity.setToolbarAsBack(this, R.id.toolbar, mEditorView.getName());
}
项目:MultiItem    文件:FullSpanGridActivity.java   
@AfterViews
protected void initViews() {
    setTitle(R.string.head_foot_grid_title);

    recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
    //初始化adapter
    BaseItemAdapter adapter = new BaseItemAdapter();
    //为XXBean数据源注册XXManager管理类
    adapter.register(TextBean.class, new FullSpanTextViewManager());
    adapter.register(ImageTextBean.class, new ImageAndTextManager());
    adapter.register(ImageBean.class, new ImageViewManager());
    //充满宽度详见ViewHolderManager#isFullSpan返回true即可,其实不一定是head或者foot
    TextView headView1 = new TextView(this);
    headView1.setText("通过addHeadView增加的充满宽度的head");
    //使用HeadFootHolderManager已经实现isFullSpan方法,默认全屏
    adapter.addHeadView(headView1);
    TextView footView1 = new TextView(this);
    footView1.setText("通过addFootView增加充满宽度的foot1");
    adapter.addFootView(footView1);
    recyclerView.setAdapter(adapter);
    List<Object> list = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
        if (i == 1) {
            list.add(new TextBean("FullSpanTextViewManager充满宽度Item"));
        }
        list.add(new ImageBean(R.drawable.img1));
        list.add(new ImageTextBean(R.drawable.img2, "BBB" + i));
    }
    adapter.setDataItems(list);
}