本文整理汇总了Java中io.plaidapp.data.prefs.DribbblePrefs类的典型用法代码示例。如果您正苦于以下问题:Java DribbblePrefs类的具体用法?Java DribbblePrefs怎么用?Java DribbblePrefs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DribbblePrefs类属于io.plaidapp.data.prefs包,在下文中一共展示了DribbblePrefs类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateViewHolder
import io.plaidapp.data.prefs.DribbblePrefs; //导入依赖的package包/类
@Override
public FilterViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
final FilterViewHolder holder = new FilterViewHolder(LayoutInflater.from(viewGroup
.getContext()).inflate(R.layout.filter_item, viewGroup, false));
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final int position = holder.getAdapterPosition();
if (position == RecyclerView.NO_POSITION) return;
final Source filter = filters.get(position);
if (isAuthorisedDribbbleSource(filter) &&
!DribbblePrefs.get(holder.itemView.getContext()).isLoggedIn()) {
authoriser.requestDribbbleAuthorisation(holder.filterIcon, filter);
} else {
filter.active = !filter.active;
holder.filterName.setEnabled(filter.active);
notifyItemChanged(position, filter.active ? FilterAnimator.FILTER_ENABLED
: FilterAnimator.FILTER_DISABLED);
SourceManager.updateSource(filter, holder.itemView.getContext());
dispatchFiltersChanged(filter);
}
}
});
return holder;
}
示例2: onCreate
import io.plaidapp.data.prefs.DribbblePrefs; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dribbble_login);
container = (ViewGroup) findViewById(R.id.container);
message = (TextView) findViewById(R.id.login_message);
login = (Button) findViewById(R.id.login);
loading = (ProgressBar) findViewById(R.id.loading);
loginFailed = (TextView) container.findViewById(R.id.login_failed_message);
loading.setVisibility(View.GONE);
dribbblePrefs = DribbblePrefs.get(this);
if (!FabTransform.setup(this, container)) {
MorphTransform.setup(this, container,
ContextCompat.getColor(this, R.color.background_light),
getResources().getDimensionPixelSize(R.dimen.dialog_corners));
}
if (savedInstanceState != null) {
isLoginFailed = savedInstanceState.getBoolean(STATE_LOGIN_FAILED, false);
loginFailed.setVisibility(isLoginFailed ? View.VISIBLE : View.GONE);
}
checkAuthCallback(getIntent());
}
示例3: onCreate
import io.plaidapp.data.prefs.DribbblePrefs; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dribbble_login);
ButterKnife.bind(this);
loading.setVisibility(View.GONE);
dribbblePrefs = DribbblePrefs.get(this);
if (!FabTransform.setup(this, container)) {
MorphTransform.setup(this, container,
ContextCompat.getColor(this, R.color.background_light),
getResources().getDimensionPixelSize(R.dimen.dialog_corners));
}
if (savedInstanceState != null) {
isLoginFailed = savedInstanceState.getBoolean(STATE_LOGIN_FAILED, false);
loginFailed.setVisibility(isLoginFailed ? View.VISIBLE : View.GONE);
}
checkAuthCallback(getIntent());
}
示例4: onCreateViewHolder
import io.plaidapp.data.prefs.DribbblePrefs; //导入依赖的package包/类
@Override
public FilterViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
final FilterViewHolder holder = new FilterViewHolder(LayoutInflater.from(viewGroup
.getContext()).inflate(R.layout.filter_item, viewGroup, false));
holder.itemView.setOnClickListener(v -> {
final int position = holder.getAdapterPosition();
if (position == RecyclerView.NO_POSITION) return;
final Source filter = filters.get(position);
if (isAuthorisedDribbbleSource(filter) &&
!DribbblePrefs.get(holder.itemView.getContext()).isLoggedIn()) {
authoriser.requestDribbbleAuthorisation(holder.filterIcon, filter);
} else {
filter.active = !filter.active;
holder.filterName.setEnabled(filter.active);
notifyItemChanged(position, filter.active ? FilterAnimator.FILTER_ENABLED
: FilterAnimator.FILTER_DISABLED);
SourceManager.updateSource(filter, holder.itemView.getContext());
dispatchFiltersChanged(filter);
}
});
return holder;
}
示例5: checkAuthCallback
import io.plaidapp.data.prefs.DribbblePrefs; //导入依赖的package包/类
private void checkAuthCallback(Intent intent) {
if (intent != null
&& intent.getData() != null
&& !TextUtils.isEmpty(intent.getData().getAuthority())
&& DribbblePrefs.LOGIN_CALLBACK.equals(intent.getData().getAuthority())) {
showLoading();
getAccessToken(intent.getData().getQueryParameter("code"));
}
}
示例6: BaseDataManager
import io.plaidapp.data.prefs.DribbblePrefs; //导入依赖的package包/类
public BaseDataManager(@NonNull Context context) {
loadingCount = new AtomicInteger(0);
designerNewsPrefs = DesignerNewsPrefs.get(context);
dribbblePrefs = DribbblePrefs.get(context);
}
示例7: getDribbblePrefs
import io.plaidapp.data.prefs.DribbblePrefs; //导入依赖的package包/类
public DribbblePrefs getDribbblePrefs() {
return dribbblePrefs;
}