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


Java R类代码示例

本文整理汇总了Java中com.fastaccess.R的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


R类属于com.fastaccess包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: textSelector

import com.fastaccess.R; //导入依赖的package包/类
public static ColorStateList textSelector(int normalColor, int pressedColor) {
    return new ColorStateList(
            new int[][]{
                    new int[]{android.R.attr.state_pressed},
                    new int[]{android.R.attr.state_focused},
                    new int[]{android.R.attr.state_activated},
                    new int[]{android.R.attr.state_selected},
                    new int[]{}
            },
            new int[]{
                    pressedColor,
                    pressedColor,
                    pressedColor,
                    pressedColor,
                    normalColor
            }
    );
}
 
开发者ID:k0shk0sh,项目名称:NewKam,代码行数:19,代码来源:ViewHelper.java

示例2: permissions

import com.fastaccess.R; //导入依赖的package包/类
@NonNull @Override protected List<PermissionModel> permissions() {
    return Arrays.asList(
            PermissionModelBuilder
                    .withContext(this.getApplicationContext())
                    .withCanSkip(false)
                    .withExplanationMessage(R.string.write_sdcard_explanation)
                    .withFontType("fonts/app_font.ttf")
                    .withMessage(R.string.write_sdcard_msg)
                    .withTitle(R.string.write_sdcard_title)
                    .withPermissionName(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                    .withLayoutColorRes(R.color.primary_dark)
                    .withImageResourceId(R.drawable.ic_computing_cloud)
                    .build(),
            PermissionModelBuilder
                    .withContext(this.getApplicationContext())
                    .withCanSkip(false)
                    .withExplanationMessage(R.string.read_sdcard_explanation)
                    .withFontType("fonts/app_font.ttf")
                    .withMessage(R.string.read_sdcard_msg)
                    .withTitle(R.string.read_sdcard_title)
                    .withPermissionName(Manifest.permission.READ_EXTERNAL_STORAGE)
                    .withImageResourceId(R.drawable.ic_computing_cloud)
                    .withLayoutColorRes(R.color.primary_dark)
                    .build());
}
 
开发者ID:k0shk0sh,项目名称:NewKam,代码行数:26,代码来源:PermissionActivity.java

示例3: onCreate

import com.fastaccess.R; //导入依赖的package包/类
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
    setTheme(R.style.AppTheme);
    super.onCreate(savedInstanceState);
    setToolbarIcon(R.drawable.ic_menu);
    navigation.setNavigationItemSelectedListener(getPresenter());
    recycler.setEmptyView(empty, null);
    emptyText.setText(R.string.no_apps);
    adapter = new AppsAdapter(new ArrayList<AppsModel>(), getPresenter(), selection);
    recycler.setAdapter(adapter);
    fastScroll.attachRecyclerView(recycler);
    fastScroll.attachAppBarLayout(coordinatorLayout, appbar);
    getSupportLoaderManager().initLoader(0, null, getPresenter());
    if (showActionMode) {
        actionMode = startSupportActionMode(getPresenter());
        actionMode.setTitle(getString(R.string.backup) + " ( " + adapter.selectionSize() + " )");
    }
}
 
开发者ID:k0shk0sh,项目名称:NewKam,代码行数:18,代码来源:MainView.java

示例4: collapseFAService

import com.fastaccess.R; //导入依赖的package包/类
public static void collapseFAService(Context context, int size) {
    context.stopService(new Intent(context, FloatingService.class));
    Intent notificationIntent = new Intent(context, FloatingService.class);
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    PendingIntent pendingIntent = PendingIntent.getService(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context);
    int icon = R.drawable.ic_fa_notification;
    long finalTime = System.currentTimeMillis();
    if (PrefHelper.getBoolean(PrefConstant.STATUS_BAR_HIDDEN)) {
        icon = R.drawable.ic_notification;
    }
    notificationBuilder
            .setPriority(Notification.PRIORITY_LOW)
            .setWhen(finalTime)
            .setSmallIcon(icon)
            .setContentTitle(context.getString(R.string.app_name))
            .setContentText(context.getString(R.string.click_to_start_service))
            .setNumber(size)
            .setAutoCancel(false)
            .setOngoing(true);
    NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    notificationBuilder.setContentIntent(pendingIntent);
    notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build());
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:25,代码来源:NotificationHelper.java

示例5: transformPage

import com.fastaccess.R; //导入依赖的package包/类
@Override public void transformPage(View view, float position) {
    int pageWidth = view.getWidth();
    View message = view.findViewById(R.id.introTitle);
    View title = view.findViewById(R.id.introDescription);
    View image = view.findViewById(R.id.introImage);
    if (position >= -1) {
        if (position <= 0) {
            setTranslationX(view, -position);
            setTranslationX(message, pageWidth * position);
            setTranslationX(title, pageWidth * position);
            image.animate().scaleX(1 + position).scaleY(1 + position);
            setAlpha(message, 1 + position);
            setAlpha(title, 1 + position);
            setAlpha(image, 1 + position);
        } else if (position <= 1) { // (0,1]
            setTranslationX(view, position);
            setTranslationX(message, pageWidth * position);
            setTranslationX(title, pageWidth * position);
            image.animate().scaleX(1 - position).scaleY(1 - position);
            setAlpha(image, 1 - position);
            setAlpha(message, 1 - position);
            setAlpha(title, 1 - position);
            setAlpha(image, 1 - position);
        }
    }
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:27,代码来源:IntroTransformer.java

示例6: showTooltip

import com.fastaccess.R; //导入依赖的package包/类
@SuppressWarnings("ConstantConditions,PrivateResource")
public static void showTooltip(@NonNull final View view, @StringRes final int titleResId,
                               int gravity, @Nullable final OnTooltipDismissListener dismissListener) {
    if (view != null && view.getContext() != null) {
        if (!PrefHelper.getBoolean(String.valueOf(titleResId))) {
            new Tooltip.Builder(view)
                    .setText(titleResId)
                    .setTypeface(TypeFaceHelper.getTypeface())
                    .setTextColor(Color.WHITE)
                    .setGravity(gravity)
                    .setPadding(R.dimen.spacing_xs_large)
                    .setBackgroundColor(ContextCompat.getColor(view.getContext(), R.color.primary))
                    .setDismissOnClick(true)
                    .setCancelable(true)
                    .setTextStyle(android.support.v7.appcompat.R.style.TextAppearance_AppCompat_Title_Inverse)
                    .setOnDismissListener(new OnDismissListener() {
                        @Override public void onDismiss() {
                            PrefHelper.set(String.valueOf(titleResId), true);
                            if (dismissListener != null) dismissListener.onDismissed(titleResId);
                        }
                    })
                    .show();
        }
    }
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:26,代码来源:ViewHelper.java

示例7: getFinalSize

import com.fastaccess.R; //导入依赖的package包/类
public static int getFinalSize(@NonNull Context context) {
    int imageSize = ViewGroup.MarginLayoutParams.WRAP_CONTENT;
    int iconSize = PrefHelper.getInt(PrefConstant.MANUAL_SIZE);
    String size = PrefHelper.getString(PrefConstant.ICON_SIZE);
    if (iconSize > 0) {
        imageSize = ViewHelper.toPx(context, iconSize);
    } else {
        if (InputHelper.isEmpty(size)) size = "medium";
        if (size.equalsIgnoreCase("small")) {
            imageSize = context.getResources().getDimensionPixelSize(R.dimen.fa_size_small);
        } else if (size.equalsIgnoreCase("medium")) {
            imageSize = context.getResources().getDimensionPixelSize(R.dimen.fa_size_medium);
        } else if (size.equalsIgnoreCase("large")) {
            imageSize = context.getResources().getDimensionPixelSize(R.dimen.fa_size_large);
        }
    }
    return imageSize;
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:19,代码来源:PrefConstant.java

示例8: getGapSize

import com.fastaccess.R; //导入依赖的package包/类
public static int getGapSize(@NonNull Resources resources) {
    String gap = PrefHelper.getString(ICON_PADDING);
    int gapSize = resources.getDimensionPixelSize(R.dimen.spacing_normal);
    if (!InputHelper.isEmpty(gap)) {
        if (gap.equalsIgnoreCase("small")) {
            gapSize = resources.getDimensionPixelSize(R.dimen.spacing_micro);
        } else if (gap.equalsIgnoreCase("medium")) {
            gapSize = resources.getDimensionPixelSize(R.dimen.spacing_normal);

        } else if (gap.equalsIgnoreCase("large")) {
            gapSize = resources.getDimensionPixelSize(R.dimen.spacing_xs_large);
        } else {
            gapSize = resources.getDimensionPixelSize(R.dimen.spacing_normal);
        }
    }
    return gapSize;
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:18,代码来源:PrefConstant.java

示例9: setupToolbarAndStatusBar

import com.fastaccess.R; //导入依赖的package包/类
private void setupToolbarAndStatusBar() {
    if (AppHelper.isLollipopOrHigher()) {
        changeAppColor();
    }
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        if (canBack()) {
            if (getSupportActionBar() != null) {
                if (toolbar != null) {
                    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            supportFinishAfterTransition();
                        }
                    });
                }
                getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_back);
                getSupportActionBar().setDisplayHomeAsUpEnabled(true);
            }
        }
    }
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:23,代码来源:BaseActivity.java

示例10: onShareUserBackup

import com.fastaccess.R; //导入依赖的package包/类
@Override public void onShareUserBackup(@NonNull MainView mainView, @NonNull FirebaseUser currentUser) {
    String packageName = mainView.getApplicationContext().getPackageName();
    Uri deepLinkBuilder = new Uri.Builder()
            .scheme("http")
            .authority(BuildConfig.FA_HOST)
            .appendQueryParameter(BuildConfig.SHARED_URI, currentUser.getUid())
            .build();
    Uri.Builder builder = new Uri.Builder()
            .scheme("https")
            .authority(mainView.getResources().getString(R.string.link_ref) + ".app.goo.gl")
            .path("/")
            .appendQueryParameter("link", Uri.parse(deepLinkBuilder.toString()).toString())
            .appendQueryParameter("apn", packageName);
    ShareCompat.IntentBuilder.from(mainView)
            .setType("message/*")
            .setSubject(mainView.getString(R.string.sharing_backup))
            .setChooserTitle(mainView.getString(R.string.share_my_backup))
            .setHtmlText("<a href='" + Uri.decode(builder.toString()) + "'>" + mainView.getString(R.string.click_here_html) +
                    "</a><br/><b>~" + mainView.getString(R.string.app_name) + "</b>").startChooser();
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:21,代码来源:MainPresenter.java

示例11: onClick

import com.fastaccess.R; //导入依赖的package包/类
@OnClick({R.id.gPlus, R.id.facebook, R.id.twitter, R.id.github}) public void onClick(View view) {
    switch (view.getId()) {
        case R.id.gPlus:
            getPresenter().onOpenGooglePlus(this);
            break;
        case R.id.facebook:
            getPresenter().onOpenFacebook(this);
            break;
        case R.id.twitter:
            getPresenter().onOpenTwitter(this);
            break;
        case R.id.github:
            getPresenter().onOpenGithub(this);
            break;
    }
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:17,代码来源:AboutMeView.java

示例12: onShow

import com.fastaccess.R; //导入依赖的package包/类
@SuppressLint("InflateParams")
@Override public void onShow(@NonNull WindowManager windowManager, @NonNull View view, @NonNull FolderModel folder) {
    this.windowManager = windowManager;
    Context context = view.getContext();
    drawerHolder = new AppDrawerHolder(LayoutInflater.from(view.getContext()).inflate(R.layout.floating_folder_layout, null, false), this);
    adapter = new FloatingFolderAppsAdapter(new ArrayList<AppsModel>(), getPresenter(), false);
    drawerHolder.recycler.setAdapter(adapter);
    drawerHolder.emptyText.setText(R.string.no_apps);
    drawerHolder.recycler.setEmptyView(drawerHolder.emptyText);
    drawerHolder.folderName.setText(folder.getFolderName());
    NinePatchDrawable drawable = (NinePatchDrawable) drawerHolder.appDrawer.getBackground();
    drawable.setColorFilter(new PorterDuffColorFilter(folder.getColor(),
            PorterDuff.Mode.MULTIPLY));
    setupParams(windowManager);
    appsLoader = new SelectedAppsLoader(context, folder.getId());
    appsLoader.registerListener(folder.hashCode(), getPresenter());
    appsLoader.startLoading();
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:19,代码来源:FloatingDrawerView.java

示例13: onRestore

import com.fastaccess.R; //导入依赖的package包/类
@Override public void onRestore(@NonNull DatabaseReference databaseReference, @Nullable String userId) {
    this.userId = userId;
    FirebaseUser user = getView().user();
    if (InputHelper.isEmpty(userId)) {
        if (user != null) userId = user.getUid();
    }
    if (InputHelper.isEmpty(userId)) {
        getView().onShowMessage(R.string.login_first_msg);
        getView().finishOnError();
    } else {
        getView().onShowProgress();
        Query query = databaseReference
                .child(userId);
        query.keepSynced(true);
        query.addListenerForSingleValueEvent(this);
    }
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:18,代码来源:RestorePresenter.java

示例14: onDataChange

import com.fastaccess.R; //导入依赖的package包/类
@Override public void onDataChange(DataSnapshot dataSnapshot) {
    if (!isAttached()) return;
    if (dataSnapshot != null && dataSnapshot.hasChildren()) {
        FirebaseUser user = getView().user();
        if (InputHelper.isEmpty(userId)) {
            if (user != null) userId = user.getUid();
        }
        if (userId == null) {
            getView().onHideProgress();
            getView().onShowMessage(R.string.login_first_msg);
            getView().finishOnError();
            return;
        }
        Logger.e(dataSnapshot);
        BackupRestoreModel.restore(dataSnapshot.getValue(BackupRestoreModel.class));
        getView().onHideProgress();
        getView().onRestoreCompleted();
    } else {
        getView().onHideProgress();
        getView().onShowMessage(R.string.no_data_to_restore);
        getView().finishOnError();
    }
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:24,代码来源:RestorePresenter.java

示例15: onActivityResult

import com.fastaccess.R; //导入依赖的package包/类
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == SIGN_IN_REQUEST_CODE) {
        if (isAttached()) {
            GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
            if (result.isSuccess()) {
                GoogleSignInAccount account = result.getSignInAccount();
                if (account != null) {
                    getView().onSignedIn(account);
                } else {
                    getView().onShowMessage(R.string.failed_login);
                }
            } else {
                getView().onShowMessage(R.string.failed_login);
            }
        }
    }

}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:19,代码来源:LoginPresenter.java


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