當前位置: 首頁>>代碼示例>>Java>>正文


Java UiThread類代碼示例

本文整理匯總了Java中org.androidannotations.annotations.UiThread的典型用法代碼示例。如果您正苦於以下問題:Java UiThread類的具體用法?Java UiThread怎麽用?Java UiThread使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UiThread類屬於org.androidannotations.annotations包,在下文中一共展示了UiThread類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setVoteDirection

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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);
}
 
開發者ID:AlbinoDrought,項目名稱:party-reader,代碼行數:22,代碼來源:DetailedPostItemView.java

示例2: setVoteDirection

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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);
}
 
開發者ID:AlbinoDrought,項目名稱:party-reader,代碼行數:22,代碼來源:CommentItemView.java

示例3: startDragChild

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
/**
 * 指定位置の子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);
}
 
開發者ID:plenprojectcompany,項目名稱:plen-Scenography_Android,代碼行數:21,代碼來源:PlenProgramView.java

示例4: notifyLocationUnavailable

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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);
}
 
開發者ID:plenprojectcompany,項目名稱:plen-Scenography_Android,代碼行數:17,代碼來源:MainActivity.java

示例5: updateFragment

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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();
    }
}
 
開發者ID:plenprojectcompany,項目名稱:plen-Scenography_Android,代碼行數:17,代碼來源:MainActivity.java

示例6: setListAdapter

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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() + ")"));
}
 
開發者ID:rumboalla,項目名稱:apkupdater,代碼行數:18,代碼來源:InstalledAppFragment.java

示例7: setListAdapter

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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);
}
 
開發者ID:rumboalla,項目名稱:apkupdater,代碼行數:20,代碼來源:SearchFragment.java

示例8: initProgressBar

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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();
	}
}
 
開發者ID:rumboalla,項目名稱:apkupdater,代碼行數:19,代碼來源:UpdaterFragment.java

示例9: setProgressBarProgress

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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();
	}
}
 
開發者ID:rumboalla,項目名稱:apkupdater,代碼行數:24,代碼來源:UpdaterFragment.java

示例10: initDrawer

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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();
}
 
開發者ID:Pierry,項目名稱:cartolapp,代碼行數:24,代碼來源:ToolbarBase.java

示例11: apiDataListGot

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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);
}
 
開發者ID:chaincloud-dot-com,項目名稱:chaincloud-v,代碼行數:25,代碼來源:AddressHistoryActivity.java

示例12: badgeNotifierCommentsAudit

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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();
    }
}
 
開發者ID:Orange-OpenSource,項目名稱:ocara,代碼行數:18,代碼來源:SetupAuditPathActivity.java

示例13: modificationView

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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;
     }

 }
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:25,代碼來源:MineFragment.java

示例14: processException

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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);
	}
	
}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:17,代碼來源:ReleasedRentFragment.java

示例15: rentSuccess

import org.androidannotations.annotations.UiThread; //導入依賴的package包/類
@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();
			}
		}
	});
}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:19,代碼來源:ReleasedRentNextFragment.java


注:本文中的org.androidannotations.annotations.UiThread類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。