Java Code Examples for org.androidannotations.annotations.UiThread

The following are top voted examples for showing how to use org.androidannotations.annotations.UiThread. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: party-reader   File: DetailedPostItemView.java   View source code 6 votes vote down vote up
@UiThread
protected void setVoteDirection(VoteDirection voteDirection) {
    int dvColor = this.colorNoVote;
    int uvColor = this.colorNoVote;
    int gColor = this.colorScore;

    switch (voteDirection) {
        case UPVOTE:
            uvColor = this.colorUpvote;
            gColor = this.colorUpvote;
            break;
        case DOWNVOTE:
            dvColor = this.colorDownvote;
            gColor = this.colorDownvote;
            break;
    }

    this.btnDownvote.setTextColor(dvColor);
    this.btnUpvote.setTextColor(uvColor);
    this.txtPostVotes.setTextColor(gColor);
}
 
Example 2
Project: party-reader   File: CommentItemView.java   View source code 6 votes vote down vote up
@UiThread
protected void setVoteDirection(VoteDirection direction) {
    int dvColor = this.colorNoVote;
    int uvColor = this.colorNoVote;
    int gColor = this.colorScore;

    switch (direction) {
        case UPVOTE:
            uvColor = this.colorUpvote;
            gColor = this.colorUpvote;
            break;
        case DOWNVOTE:
            dvColor = this.colorDownvote;
            gColor = this.colorDownvote;
            break;
    }

    this.btnDownvote.setTextColor(dvColor);
    this.btnUpvote.setTextColor(uvColor);
    this.txtCommentScore.setTextColor(gColor);
}
 
Example 3
Project: plen-Scenography_Android   File: PlenProgramView.java   View source code 6 votes vote down vote up
/**
 * 指定位置の子Viewのドラッグを開始する.
 *
 * @param position 子Viewの位置
 */
@UiThread
void startDragChild(int position) {
    PlenProgramAdapter adapter = mAdapter.orElseThrow(AssertionError::new);

    View pressedView = getChildAt(position - getFirstVisiblePosition());
    PlenCodeUnit unit = adapter.getItem(position);
    adapter.replaceByBlankRow(position);

    pressedView.setPressed(true);
    pressedView.startDrag(
            new DragDataBuilder(getContext())
                    .unit(unit)
                    .build(),
            new DragShadowBuilder(pressedView), null, 0);
}
 
Example 4
Project: plen-Scenography_Android   File: MainActivity.java   View source code 6 votes vote down vote up
@UiThread
@Override
public void notifyLocationUnavailable() {
    CompositeSubscription subscriptions = new CompositeSubscription();
    LocationSettingRequestDialogFragment fragment = LocationSettingRequestDialogFragment_.builder()
            .build();
    fragment.allowEvent()
            .lift(Operators.composite(subscriptions))
            .subscribe(v -> {
                Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                int requestCode = 1;
                startActivityForResult(intent, requestCode);
            });
    mFragmentManager.ifPresent(m -> fragment.show(m, LOCATION_SETTING_DIALOG));
    mSubscriptions.add(subscriptions);
}
 
Example 5
Project: plen-Scenography_Android   File: MainActivity.java   View source code 6 votes vote down vote up
@UiThread
void updateFragment() {
    if (mPref.joystickVisibility().get()) {
        Picasso.with(this).load(R.drawable.programming_icon).into(mJoystickIcon);
        getFragmentManager()
                .beginTransaction()
                .replace(R.id.container, JoystickFragment_.builder().build())
                .commit();
    } else {
        Picasso.with(this).load(R.drawable.joystick_icon).into(mJoystickIcon);
        getFragmentManager()
                .beginTransaction()
                .replace(R.id.container, ProgrammingFragment_.builder().build())
                .commit();
    }
}
 
Example 6
Project: apkupdater   File: InstalledAppFragment.java   View source code 6 votes vote down vote up
@UiThread(propagation = UiThread.Propagation.REUSE)
protected void setListAdapter(
	List<InstalledApp> items
) {
	if (mRecyclerView == null || mBus == null) {
		return;
	}

	mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
       if (new UpdaterOptions(getContext()).disableAnimations()) {
           mRecyclerView.setItemAnimator(null);
       } else {
           ((SimpleItemAnimator) mRecyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
       }
	mRecyclerView.setAdapter(new InstalledAppAdapter(getContext(), mRecyclerView, items));
	mBus.post(new InstalledAppTitleChange(getString(R.string.tab_installed) + " (" + items.size() + ")"));
}
 
Example 7
Project: apkupdater   File: SearchFragment.java   View source code 6 votes vote down vote up
@UiThread(propagation = UiThread.Propagation.REUSE)
protected void setListAdapter(
	@NonNull List<InstalledApp> items
) {
	if (mRecyclerView == null || mBus == null || mProgressBar == null) {
		return;
	}

	mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
       if (new UpdaterOptions(getContext()).disableAnimations()) {
           mRecyclerView.setItemAnimator(null);
       } else {
           ((SimpleItemAnimator) mRecyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
       }
	mAdapter.init(getActivity(), mRecyclerView, items);
	mRecyclerView.setAdapter(mAdapter);
	mBus.post(new SearchTitleChange(getString(R.string.tab_search) + " (" + items.size() + ")"));
	mProgressBar.setVisibility(View.GONE);
}
 
Example 8
Project: apkupdater   File: UpdaterFragment.java   View source code 6 votes vote down vote up
@UiThread(propagation = UiThread.Propagation.REUSE)
void initProgressBar(
) {
	try {
		mLoader.getIndeterminateDrawable().setColorFilter(
			ColorUtil.getColorFromTheme(getActivity().getTheme(), R.attr.colorAccent),
			android.graphics.PorterDuff.Mode.MULTIPLY
		);
		setProgressBarProgress(mProgressCount, mProgressMax);
		if (mProgressMax == 0 && mProgressCount == 0) {
			setProgressBarVisibility(GONE);
		} else {
			setProgressBarVisibility(VISIBLE);
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example 9
Project: apkupdater   File: UpdaterFragment.java   View source code 6 votes vote down vote up
@UiThread(propagation = UiThread.Propagation.REUSE)
void setProgressBarProgress(
	int progress,
	int max
) {
	try {
		AnimationUtil.startSlideAnimation(getContext(), mLoaderContainer);

		// Change progress bar
		mLoader.setMax(max);
		mLoader.setProgress(progress);
		if (progress == 0 && max == 0) {
			mLoader.setIndeterminate(true);
		} else {
			mLoader.setIndeterminate(false);
		}

		// Change text
		mLoaderText.setText(progress + "/" + max);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example 10
Project: cartolapp   File: ToolbarBase.java   View source code 6 votes vote down vote up
@UiThread void initDrawer() {
  PrimaryDrawerItem home =
      new PrimaryDrawerItem().withName(R.string.home).withIcon(GoogleMaterial.Icon.gmd_home);
  new DrawerBuilder().withActivity((Activity) act)
      .withToolbar(toolbar)
      .withHasStableIds(true)
      .withTranslucentStatusBar(true)
      .withSelectedItem(-1)
      .withAccountHeader(headerResult)
      .addDrawerItems(home)
      .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
        @Override public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
          switch (position) {
            case 1:
              context.startActivity(new Intent(context, MainActivity_.class));
              return true;
            default:
              return true;
          }
        }
      })
      .build();
}
 
Example 11
Project: chaincloud-v   File: AddressHistoryActivity.java   View source code 6 votes vote down vote up
@UiThread
void apiDataListGot(boolean replace, List<AddressHistory> deltaAddresses) {
    if (refresher.isRefreshing() && !replace) {
        return;
    }
    if (replace) {
        refresher.setRefreshing(false);
        if (deltaAddresses != null && deltaAddresses.size() > 0) {
            addresses.clear();
        }
    }
    if (deltaAddresses != null) {
        int from = addresses.size();
        addresses.addAll(deltaAddresses);
        if (!replace) {
            adapter.notifyItemRangeInserted(from, deltaAddresses.size());
        }
    }
    if (deltaAddresses != null && replace) {
        adapter.notifyDataSetChanged();
    }
    adapter.setLoading(false);
    adapter.setNoMore(deltaAddresses == null || deltaAddresses.size() == 0);
}
 
Example 12
Project: ocara   File: SetupAuditPathActivity.java   View source code 6 votes vote down vote up
@UiThread(propagation = UiThread.Propagation.REUSE)
public  void badgeNotifierCommentsAudit(){
    View target = findViewById(com.orange.ocara.R.id.action_comment);
    if(target ==null  ){
        return;
    }
    if (badge != null) {
        badge.hide();
    }
    badge = new BadgeView(this, target);
     List<Comment> nbrComments=audit.getComments();
    if (!audit.getComments().isEmpty()) {
       badge.setText(String.valueOf(nbrComments.size()));
        badge.setBadgeMargin(0, 4);
        badge.show();
    }
}
 
Example 13
Project: ShoppingMall   File: MineFragment.java   View source code 6 votes vote down vote up
@UiThread
 public void modificationView() {

     //修改手机号码
// mRes.getSpreadId()
     MminePhoneNumber.setText(mRes.getSpreadId());

     //是否可以修改手机号码  0:可以修改 1:不能修改
     switch (mRes.getAllowUpdateMobile()) {
         case 0:
             mModificationMinePhone.setTextColor(Color.parseColor("#39A3E2"));
             //  mModificationMinePhone.setBackgroundColor(Color.parseColor("#FF4404"));

             mModificationMinePhone.setText(getString(R.string.change_new_phone_text));

             break;
         case 1:
             //  android:background="#FF4404"
             mModificationMinePhone.setTextColor(Color.parseColor("#7f7f7f"));
             mModificationMinePhone.setText(getString(R.string.change_new_phone_text));
             break;
     }

 }
 
Example 14
Project: ShoppingMall   File: ReleasedRentFragment.java   View source code 6 votes vote down vote up
@UiThread
void processException(){
	mRentSingleBuilding.setVisibility(View.VISIBLE);
	mRentSingleBuilding.setChecked(false);
	mRentSingleBuilding.setClickable(true);
	
	mRentSeatNumber.setVisibility(View.VISIBLE);
	mRentSeatNumber.setFocusable(true);
	mRentSeatNumber.setFocusableInTouchMode(true);
	mRentSeatNumber.requestFocus();
	if (cityId == Constants.ID_CITY_BEIJING) {
		mRentUnitNumberLayout.setVisibility(View.VISIBLE);
		mRentUnitPrompt.setVisibility(View.VISIBLE);
	}
	
}
 
Example 15
Project: ShoppingMall   File: ReleasedRentNextFragment.java   View source code 6 votes vote down vote up
@UiThread
public void rentSuccess(String message) {
	ManyiUtils.closeKeyBoard(getActivity(), mRentArea);
	DialogBuilder.showSimpleDialog(message, getBackOpActivity(), new OnClickListener() {

		@Override
		public void onClick(DialogInterface dialog, int which) {
			if (CheckDoubleClick.isFastDoubleClick()) {
				return;
			}
			if (getSelectListener() != null) {
				notifySelected(null);
			}else{
				remove();
			}
		}
	});
}
 
Example 16
Project: ShoppingMall   File: SellSearchResultFragment.java   View source code 6 votes vote down vote up
@Override
@UiThread
public void upData() {
	if ((mRes.getHouseList() == null || mRes.getHouseList().size() == 0) && catchLayout.getVisibility() == View.GONE) {
		noDataTv.setVisibility(View.VISIBLE);
	} else {
		noDataTv.setVisibility(View.GONE);
	}

	if (mAdapter == null) {
		mAdapter = new Adapter((LayoutInflater) getBackOpActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE), mRes);
		mPullRefreshListView.setAdapter(mAdapter);
	} else {
		mAdapter.res = mRes;
		mAdapter.notifyDataSetChanged();
		mPullRefreshListView.onRefreshComplete();
	}

}
 
Example 17
Project: ShoppingMall   File: RegisterNextFragment.java   View source code 6 votes vote down vote up
@UiThread
public void takePhoto(String path) {
	ManyiUtils.closeKeyBoard(getBackOpActivity(), mRealNameEditText);
	TakePhotoFragment takePhotoFragment = GeneratedClassUtils.getInstance(TakePhotoFragment.class);
	Bundle argsBundle = new Bundle();
	argsBundle.putString("photoPath", path);
	takePhotoFragment.setArguments(argsBundle);
	takePhotoFragment.tag = TakePhotoFragment.class.getName();
	takePhotoFragment.setManager(getFragmentManager());
	takePhotoFragment.show(SHOW_ADD_HIDE);
	takePhotoFragment.setSelectListener(new SelectListener<Object>() {

		@Override
		public void onSelected(Object t) {

		}

		@Override
		public void onCanceled() {
			updateCodePhotos();
			updateCardPhotos();
			getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		}
	});
}
 
Example 18
Project: ShoppingMall   File: RegisterNextFragment.java   View source code 6 votes vote down vote up
@Click({ R.id.service_agreement })
@UiThread
public void serviceAgreement() {

	if (CheckDoubleClick.isFastDoubleClick())
		return;

	HtmlLoadFragment htmlLoadFragment = GeneratedClassUtils.getInstance(HtmlLoadFragment.class);
	htmlLoadFragment.tag = HtmlLoadFragment.class.getName();
	Bundle bundle = new Bundle();
	bundle.putString("mHtmLTitle", "服务协议");
	bundle.putString("mHtmlUrl", "agreement.html");
	htmlLoadFragment.setArguments(bundle);
	htmlLoadFragment.setCustomAnimations(R.anim.anim_fragment_in, R.anim.anim_fragment_out, R.anim.anim_fragment_close_in,
			R.anim.anim_fragment_close_out);
	htmlLoadFragment.setManager(getFragmentManager());
	htmlLoadFragment.show(SHOW_ADD_HIDE);

}
 
Example 19
Project: ShoppingMall   File: ReleaseFragment.java   View source code 6 votes vote down vote up
@UiThread
void rewardDescription() {

    HtmlLoadFragment htmlLoadFragment = GeneratedClassUtils.getInstance(HtmlLoadFragment.class);
    htmlLoadFragment.tag = HtmlLoadFragment.class.getName();
    Bundle bundle = new Bundle();
    bundle.putString("mHtmLTitle", "奖惩说明");// String mHtmLTitle, mHtmlUrl;
    String cityId_ = cityId + "";
    bundle.putString("mHtmlUrl", "/rest/common/getIncentiveAgreement.rest?cityId=" + cityId_.trim());
    htmlLoadFragment.setArguments(bundle);
    htmlLoadFragment.setCustomAnimations(R.anim.anim_fragment_in, R.anim.anim_fragment_out, R.anim.anim_fragment_close_in,
            R.anim.anim_fragment_close_out);
    htmlLoadFragment.setContainerId(R.id.main_container);
    htmlLoadFragment.setManager(getFragmentManager());

    htmlLoadFragment.show(SuperFragment.SHOW_ADD_HIDE);
}
 
Example 20
Project: ShoppingMall   File: UpdateLoginPwdFragment.java   View source code 6 votes vote down vote up
@UiThread
public void onUpdateSuccess2() {
	try {
		mUpdateSuccessDialog.dismiss();
		SharedPreferences sharedPreferences = getBackOpActivity().getSharedPreferences(Constants.LOGIN_TIMES,
				Context.MODE_PRIVATE + Context.MODE_PRIVATE);
		Editor editor = sharedPreferences.edit();
		editor.putString("password", AESUtil.encrypt(mConfirmPassword.getEditableText().toString().trim(), CommonConfig.AES_KEY));
		editor.commit();
		ManyiUtils.closeKeyBoard(getActivity(), mOldPassword);
		remove();
	} catch (Exception e) {
		e.printStackTrace();
		Thread.getDefaultUncaughtExceptionHandler().uncaughtException(null, e);
	}
}
 
Example 21
Project: ShoppingMall   File: ChangeNewPhoneNumberFragment.java   View source code 6 votes vote down vote up
@UiThread
public void onSendSMSSuccess() {
    if (getActivity() == null || getActivity().isFinishing()) {
        return;
    }
    mGetVerification.setEnabled(false);
    DialogBuilder.showSimpleDialog("验证码已发送!", getActivity(), new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            timer.start();
            int left = mGetVerification.getPaddingLeft();
            int right = mGetVerification.getPaddingRight();
            mGetVerification.setBackgroundResource(R.drawable.btn_orange_dis);
            mGetVerification.setPadding(left, 0, right, 0);
        }
    });
}
 
Example 22
Project: ShoppingMall   File: ChangeNewPhoneNumberFragment.java   View source code 6 votes vote down vote up
@UiThread
public void releaseSuccess(String message) {
    if (this.getActivity() == null || this.getActivity().isFinishing()) {
        return;
    }
    DialogBuilder.showSimpleDialog(message, getBackOpActivity(),new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            if (CheckDoubleClick.isFastDoubleClick()) {
                return;
            }

            notifySelected(null);
        }
    });
}
 
Example 23
Project: ShoppingMall   File: ForgetPasswordFragment.java   View source code 6 votes vote down vote up
@UiThread
void intentRest() {
	if ((mCode + "").equals(mForgetCode.getText().toString().trim())) {
		ResetPasswordFragment resetPasswordFragment = GeneratedClassUtils.getInstance(ResetPasswordFragment.class);
		resetPasswordFragment.tag = ResetPasswordFragment.class.getName();
		Bundle nBundle = new Bundle();
		nBundle.putString("phone", mForgetUsername.getText().toString().trim());
		resetPasswordFragment.setArguments(nBundle);
		resetPasswordFragment.setCustomAnimations(R.anim.anim_fragment_in, R.anim.anim_fragment_out, R.anim.anim_fragment_close_in,
				R.anim.anim_fragment_close_out);
		resetPasswordFragment.setManager(getFragmentManager());
		resetPasswordFragment.show(SHOW_ADD_HIDE);
		timer.cancel();
		ManyiUtils.closeKeyBoard(getActivity(), mForgetCode);
	} else {
		DialogBuilder.showSimpleDialog("请输入正确的验证码", getBackOpActivity());
	}
}
 
Example 24
Project: lockit   File: AppsFragment.java   View source code 5 votes vote down vote up
@Override
    @UiThread
    @IgnoredWhenDetached
    public void showAllApps(List<Application> allApps) {
        apps.setAdapter(appsAdapter(allApps));
        apps.setLayoutManager(new LinearLayoutManager(getActivity()));
//        ItemClickSupport.addTo(apps)
//                .setOnItemClickListener(
//                        (view, position, id) -> appSelected(appsAdapter.getItem(position)));
    }
 
Example 25
Project: party-reader   File: PostItemView.java   View source code 5 votes vote down vote up
@UiThread
protected void updateVoteColors(VoteDirection voteDirection) {
    Integer newScore = this.submission.getScore();

    if (voteDirection == VoteDirection.UPVOTE) {
        newScore += 1;
    } else if(voteDirection == VoteDirection.DOWNVOTE) {
        newScore -= 1;
    }

    this.txtScore.setText(newScore.toString());
    this.btnUpvote.setTextColor(voteDirection == VoteDirection.UPVOTE ? this.colorUpvote : this.colorNoVote);
    this.btnDownvote.setTextColor(voteDirection == VoteDirection.DOWNVOTE ? this.colorDownvote : this.colorNoVote);
}
 
Example 26
Project: party-reader   File: SubmissionDetailActivity.java   View source code 5 votes vote down vote up
@UiThread
protected void setAdapter() {
    this.grpSwipeRefresh.setRefreshing(false);
    this.loader.setVisibility(View.GONE);

    AndroidTreeView treeView = new AndroidTreeView(this, this.treeNode);
    this.grpSwipeRefresh.addView(treeView.getView());
}
 
Example 27
Project: party-reader   File: SubredditActivity.java   View source code 5 votes vote down vote up
@UiThread
protected void bindAdapter() {
    this.grpSwipeRefresh.setRefreshing(false);
    this.loader.setVisibility(View.GONE);
    this.lvSubredditPosts.setVisibility(View.VISIBLE);

    this.getActionBar().setTitle(this.getSubredditName());

    this.lvSubredditPosts.setAdapter(this.postListAdapter);
    this.lvSubredditPosts.setOnScrollListener(new EndlessScrollListener(10) {
        @Override
        public boolean onLoadMore(int page, int totalItemsCount) {

            boolean hasMore = SubredditActivity.this.postListAdapter.hasMore();

            if (hasMore) {
                // background
                SubredditActivity.this.nextPage();
            }

            return hasMore;
        }
    });
    this.lvSubredditPosts.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            Submission submission = SubredditActivity.this.postListAdapter.getItem(i);
            SubredditActivity.this.showSubmissionDetails(submission);
        }
    });
}
 
Example 28
Project: party-reader   File: LoginActivity.java   View source code 5 votes vote down vote up
@UiThread
protected void handleSuccess() {
    String loginMessage = "Logged in as " + this.manager.getClient().getAuthenticatedUser();

    Toast.makeText(this, loginMessage, Toast.LENGTH_SHORT).show();

    this.finish();
}
 
Example 29
Project: party-reader   File: LoginActivity.java   View source code 5 votes vote down vote up
@UiThread
protected void handleError(String message) {
    Log.e("login", message);

    // TODO: A "proper" error message / screen
    Toast.makeText(this, message, Toast.LENGTH_LONG).show();

    this.finish();
}
 
Example 30
Project: plen-Scenography_Android   File: PlenMotionListView.java   View source code 5 votes vote down vote up
/**
 * 指定位置の子Viewのドラッグを開始する.
 *
 * @param position 子Viewの位置
 */
@UiThread
void startDragChild(int position) {
    PlenMotionListAdapter adapter = mAdapter.orElseThrow(AssertionError::new);

    View pressedView = getChildAt(position - getFirstVisiblePosition());
    pressedView.setPressed(true);
    pressedView.startDrag(
            new PlenProgramView.DragDataBuilder(getContext())
                    .motion(adapter.getItem(position))
                    .build(),
            new DragShadowBuilder(pressedView), null, 0);
    pressedView.setPressed(false);
}
 
Example 31
Project: plen-Scenography_Android   File: MainActivity.java   View source code 5 votes vote down vote up
@UiThread
@Override
public void notifyPlenConnectionChanged(boolean connected, boolean now) {
    if (now) {
        if (connected) {
            Toast.makeText(this, R.string.plen_connected, Toast.LENGTH_SHORT).show();
        } else {
            Toast.makeText(this, R.string.plen_disconnected, Toast.LENGTH_SHORT).show();
        }
    }
    updateToolbar();
}
 
Example 32
Project: plen-Scenography_Android   File: MainActivity.java   View source code 5 votes vote down vote up
@UiThread
void dismissDialogFragment(@NonNull String tag) {
    mFragmentManager.map(fm -> fm.findFragmentByTag(tag))
            .filter(f -> f instanceof DialogFragment)
            .map(f -> (DialogFragment) f)
            .filter(DialogFragment::getShowsDialog)
            .ifPresent(f -> f.onDismiss(f.getDialog()));
}
 
Example 33
Project: plen-Scenography_Android   File: MainActivity.java   View source code 5 votes vote down vote up
@UiThread
void setIconEnable(MenuItem item, boolean enable) {
    item.setEnabled(enable);
    Drawable icon = item.getIcon();
    if (icon != null) {
        icon.setAlpha(enable ? 255 : 64);
    }
}
 
Example 34
Project: DHK-Recollection   File: LbsFragPter.java   View source code 5 votes vote down vote up
@UiThread
 void ShowImageData() {
   if(UrlList.size()==0) {
     Toast.makeText(mainActivity, "没有数据了", Toast.LENGTH_SHORT).show();
   }
  lbsRecyclerViewAdapter.getDataList().addAll(UrlList);
  lbsRecyclerViewAdapter.notifyDataSetChanged();
  fragLbsView.pullLoadMoreRecyclerView.setPullLoadMoreCompleted();
}
 
Example 35
Project: apkupdater   File: MainFragment.java   View source code 5 votes vote down vote up
@UiThread
public void selectTab(
	int tab
) {
	if (mTabLayout != null) {
		TabLayout.Tab selectedTab = mTabLayout.getTabAt(tab);
		if (selectedTab != null) {
			selectedTab.select();
		}
	}
}
 
Example 36
Project: apkupdater   File: UpdaterFragment.java   View source code 5 votes vote down vote up
@UiThread(propagation = UiThread.Propagation.REUSE)
void setProgressBarVisibility(
	int v
) {
	try {
		AnimationUtil.startSlideAnimation(getContext(), mLoaderContainer);
		mLoaderContainer.setVisibility(v);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example 37
Project: apkupdater   File: SearchAdapter.java   View source code 5 votes vote down vote up
@UiThread
protected void changeAppInstallStatusAndNotify(
	final InstalledApp app,
	int status,
	long id,
	final int pos
) {
	if (app.getInstallStatus() != null) {
		app.getInstallStatus().setId(id);
		app.getInstallStatus().setStatus(status);
		notifyItemChanged(pos);
	}
}
 
Example 38
Project: cartolapp   File: PlayerFragment.java   View source code 5 votes vote down vote up
@UiThread void visibleOrNot(List<Player> players) {
  if (players == null || players.size() == 0) {
    empty.setVisibility(View.VISIBLE);
  } else {
    empty.setVisibility(View.INVISIBLE);
  }
}
 
Example 39
Project: cartolapp   File: ToolbarBase.java   View source code 5 votes vote down vote up
@UiThread void initAccount() {
  headerResult = new AccountHeaderBuilder().withActivity(act)
      .withHeaderBackground(R.color.colorPrimary)
      .addProfiles(new ProfileDrawerItem().withName("Usuário"))
      .withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() {
        @Override
        public boolean onProfileChanged(View view, IProfile profile, boolean currentProfile) {
          return false;
        }
      })
      .build();
}
 
Example 40
Project: newsapp   File: ChannelActivity.java   View source code 5 votes vote down vote up
@UiThread
void setData() {
    userAdapter = new DragAdapter(this, userChannelList);
    userGridView.setAdapter(userAdapter);
    otherAdapter = new OtherAdapter(this, otherChannelList);
    otherGridView.setAdapter(otherAdapter);
    // 设置GRIDVIEW的ITEM的点击监听
    otherGridView.setOnItemClickListener(this);
    userGridView.setOnItemClickListener(this);
}