当前位置: 首页>>代码示例>>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;未经允许,请勿转载。