当前位置: 首页>>代码示例>>Java>>正文


Java DribbblePrefs类代码示例

本文整理汇总了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;
}
 
开发者ID:liulinbo,项目名称:Amumu,代码行数:26,代码来源:FilterAdapter.java

示例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());
}
 
开发者ID:liulinbo,项目名称:Amumu,代码行数:27,代码来源:DribbbleLogin.java

示例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());
}
 
开发者ID:yongjhih,项目名称:android-proguards,代码行数:22,代码来源:DribbbleLogin.java

示例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;
}
 
开发者ID:nickbutcher,项目名称:plaid,代码行数:23,代码来源:FilterAdapter.java

示例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"));
    }
}
 
开发者ID:liulinbo,项目名称:Amumu,代码行数:10,代码来源:DribbbleLogin.java

示例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);
}
 
开发者ID:liulinbo,项目名称:Amumu,代码行数:6,代码来源:BaseDataManager.java

示例7: getDribbblePrefs

import io.plaidapp.data.prefs.DribbblePrefs; //导入依赖的package包/类
public DribbblePrefs getDribbblePrefs() {
    return dribbblePrefs;
}
 
开发者ID:liulinbo,项目名称:Amumu,代码行数:4,代码来源:BaseDataManager.java


注:本文中的io.plaidapp.data.prefs.DribbblePrefs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。