• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java R类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sendFDroid

import org.fdroid.fdroid.R; //导入依赖的package包/类
public void sendFDroid() {
    // If Bluetooth has not been enabled/turned on, then enabling device discoverability
    // will automatically enable Bluetooth.
    BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
    if (adapter != null) {
        if (adapter.getState() != BluetoothAdapter.STATE_ON) {
            Intent discoverBt = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
            discoverBt.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 120);
            startActivityForResult(discoverBt, REQUEST_BLUETOOTH_ENABLE_FOR_SEND);
        } else {
            sendFDroidApk();
        }
    } else {
        new AlertDialog.Builder(this)
                .setTitle(R.string.bluetooth_unavailable)
                .setMessage(R.string.swap_cant_send_no_bluetooth)
                .setNegativeButton(
                        R.string.cancel,
                        new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) { }
                        }
                ).create().show();
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:26,代码来源:SwapWorkflowActivity.java


示例2: onCreateView

import org.fdroid.fdroid.R; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {

    DisplayImageOptions displayImageOptions = new DisplayImageOptions.Builder()
            .cacheInMemory(true)
            .cacheOnDisk(true)
            .imageScaleType(ImageScaleType.NONE)
            .showImageOnLoading(R.drawable.screenshot_placeholder)
            .showImageForEmptyUri(R.drawable.screenshot_placeholder)
            .bitmapConfig(Bitmap.Config.RGB_565)
            .build();

    View rootView = inflater.inflate(R.layout.activity_screenshots_page, container, false);

    ImageView screenshotView = (ImageView) rootView.findViewById(R.id.screenshot);
    ImageLoader.getInstance().displayImage(screenshotUrl, screenshotView, displayImageOptions);

    return rootView;
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:22,代码来源:ScreenShotsActivity.java


示例3: initAutoFetchUpdatesPreference

import org.fdroid.fdroid.R; //导入依赖的package包/类
/**
 * If a user specifies they want to fetch updates automatically, then start the download of relevant
 * updates as soon as they enable the feature.
 * Also, if the user has the priv extention installed then change the label to indicate that it
 * will actually _install_ apps, not just fetch their .apk file automatically.
 */
private void initAutoFetchUpdatesPreference() {
    updateAutoDownloadPref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {

        @Override
        public boolean onPreferenceChange(Preference preference, Object newValue) {
            if (newValue instanceof Boolean && (boolean) newValue) {
                UpdateService.autoDownloadUpdates(getContext());
            }
            return true;
        }
    });

    if (PrivilegedInstaller.isDefault(getContext())) {
        updateAutoDownloadPref.setTitle(R.string.update_auto_install);
        updateAutoDownloadPref.setSummary(R.string.update_auto_install_summary);
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:24,代码来源:PreferencesFragment.java


示例4: addNameAndDescriptionToRepo

import org.fdroid.fdroid.R; //导入依赖的package包/类
/**
 * Add a name and description to the repo table, and updates the two
 * default repos with values from strings.xml.
 */
private void addNameAndDescriptionToRepo(SQLiteDatabase db, int oldVersion) {
    boolean nameExists = columnExists(db, RepoTable.NAME, RepoTable.Cols.NAME);
    boolean descriptionExists = columnExists(db, RepoTable.NAME, RepoTable.Cols.DESCRIPTION);
    if (oldVersion >= 21 || (nameExists && descriptionExists)) {
        return;
    }
    if (!nameExists) {
        db.execSQL("alter table " + RepoTable.NAME + " add column " + RepoTable.Cols.NAME + " text");
    }
    if (!descriptionExists) {
        db.execSQL("alter table " + RepoTable.NAME + " add column " + RepoTable.Cols.DESCRIPTION + " text");
    }

    String[] defaultRepos = context.getResources().getStringArray(R.array.default_repos);
    for (int i = 0; i < defaultRepos.length / REPO_XML_ARG_COUNT; i++) {
        int offset = i * REPO_XML_ARG_COUNT;
        insertNameAndDescription(db,
                defaultRepos[offset],     // name
                defaultRepos[offset + 1], // address
                defaultRepos[offset + 2] // description
        );
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:28,代码来源:DBHelper.java


示例5: onClick

import org.fdroid.fdroid.R; //导入依赖的package包/类
@Override
public void onClick(View v) {
    if (currentApp == null) {
        return;
    }

    Intent intent = new Intent(activity, AppDetails2.class);
    intent.putExtra(AppDetails2.EXTRA_APPID, currentApp.packageName);
    if (Build.VERSION.SDK_INT >= 21) {
        String transitionAppIcon = activity.getString(R.string.transition_app_item_icon);
        Pair<View, String> iconTransitionPair = Pair.create((View) icon, transitionAppIcon);
        Bundle bundle = ActivityOptionsCompat
                .makeSceneTransitionAnimation(activity, iconTransitionPair).toBundle();
        activity.startActivity(intent, bundle);
    } else {
        activity.startActivity(intent);
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:19,代码来源:AppListItemController.java


示例6: getCurrentViewState

import org.fdroid.fdroid.R; //导入依赖的package包/类
@NonNull
@Override
protected AppListItemState getCurrentViewState(
        @NonNull App app, @Nullable AppUpdateStatusManager.AppUpdateStatus appStatus) {
    String mainText;
    String actionButtonText;

    Apk suggestedApk = ApkProvider.Helper.findSuggestedApk(activity, app);
    if (shouldUpgradeInsteadOfUninstall(app, suggestedApk)) {
        mainText = activity.getString(R.string.updates__app_with_known_vulnerability__prompt_upgrade, app.name);
        actionButtonText = activity.getString(R.string.menu_upgrade);
    } else {
        mainText = activity.getString(R.string.updates__app_with_known_vulnerability__prompt_uninstall, app.name);
        actionButtonText = activity.getString(R.string.menu_uninstall);
    }

    return new AppListItemState(app)
            .setMainText(mainText)
            .showActionButton(actionButtonText)
            .showSecondaryButton(activity.getString(R.string.updates__app_with_known_vulnerability__ignore));
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:22,代码来源:KnownVulnAppListItemController.java


示例7: installPackage

import org.fdroid.fdroid.R; //导入依赖的package包/类
private void installPackage(Uri localApkUri, Uri downloadUri, Apk apk) {
    Utils.debugLog(TAG, "Installing: " + localApkUri.getPath());
    installer.sendBroadcastInstall(downloadUri, Installer.ACTION_INSTALL_STARTED);
    File path = apk.getMediaInstallPath(activity.getApplicationContext());
    path.mkdirs();
    try {
        FileUtils.copyFileToDirectory(new File(localApkUri.getPath()), path);
    } catch (IOException e) {
        Utils.debugLog(TAG, "Failed to copy: " + e.getMessage());
        installer.sendBroadcastInstall(downloadUri, Installer.ACTION_INSTALL_INTERRUPTED);
    }
    if (apk.isMediaInstalled(activity.getApplicationContext())) { // Copying worked
        Utils.debugLog(TAG, "Copying worked: " + localApkUri.getPath());
        Toast.makeText(this, String.format(this.getString(R.string.app_installed_media), path.toString()),
                Toast.LENGTH_LONG).show();
        installer.sendBroadcastInstall(downloadUri, Installer.ACTION_INSTALL_COMPLETE);
    } else {
        installer.sendBroadcastInstall(downloadUri, Installer.ACTION_INSTALL_INTERRUPTED);
    }
    finish();
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:22,代码来源:FileInstallerActivity.java


示例8: onReceive

import org.fdroid.fdroid.R; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    if (intent.hasExtra(SwapService.EXTRA_STARTING)) {
        Utils.debugLog(TAG, "Bluetooth service is starting (setting toggle to disabled, not checking because we will wait for an intent that bluetooth is actually enabled)");
        bluetoothSwitch.setEnabled(false);
        textBluetoothVisible.setText(R.string.swap_setting_up_bluetooth);
        // bluetoothSwitch.setChecked(true);
    } else {
        if (intent.hasExtra(SwapService.EXTRA_STARTED)) {
            Utils.debugLog(TAG, "Bluetooth service has started (updating text to visible, but not marking as checked).");
            textBluetoothVisible.setText(R.string.swap_visible_bluetooth);
            bluetoothSwitch.setEnabled(true);
            // bluetoothSwitch.setChecked(true);
        } else {
            Utils.debugLog(TAG, "Bluetooth service has stopped (setting switch to not-visible).");
            textBluetoothVisible.setText(R.string.swap_not_visible_bluetooth);
            setBluetoothSwitchState(false, true);
        }
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:21,代码来源:StartSwapView.java


示例9: onResume

import org.fdroid.fdroid.R; //导入依赖的package包/类
@Override
protected void onResume() {
    super.onResume();

    FDroidApp.checkStartTor(this);

    if (getIntent().hasExtra(EXTRA_VIEW_UPDATES)) {
        getIntent().removeExtra(EXTRA_VIEW_UPDATES);
        pager.scrollToPosition(adapter.adapterPositionFromItemId(R.id.updates));
        selectedMenuId = R.id.updates;
        setSelectedMenuInNav();
    } else if (getIntent().hasExtra(EXTRA_VIEW_SETTINGS)) {
        getIntent().removeExtra(EXTRA_VIEW_SETTINGS);
        pager.scrollToPosition(adapter.adapterPositionFromItemId(R.id.settings));
        selectedMenuId = R.id.settings;
        setSelectedMenuInNav();
    }

    // AppDetails2 and RepoDetailsActivity set different NFC actions, so reset here
    NfcHelper.setAndroidBeam(this, getApplication().getPackageName());
    checkForAddRepoIntent(getIntent());
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:23,代码来源:MainActivity.java


示例10: onCreate

import org.fdroid.fdroid.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    ((FDroidApp) getApplication()).applyTheme(this);

    intent = getIntent();
    Uri uri = intent.getData();
    Apk apk = ApkProvider.Helper.findByUri(this, uri, Schema.ApkTable.Cols.ALL);
    app = AppProvider.Helper.findSpecificApp(getContentResolver(),
            apk.packageName, apk.repoId, Schema.AppMetadataTable.Cols.ALL);

    appDiff = new AppDiff(getPackageManager(), apk);

    setContentView(R.layout.install_start);

    // increase dialog to full width
    getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT);

    installConfirm = findViewById(R.id.install_confirm_panel);
    installConfirm.setVisibility(View.INVISIBLE);

    startInstallConfirm();
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:26,代码来源:InstallConfirmActivity.java


示例11: onCreateViewHolder

import org.fdroid.fdroid.R; //导入依赖的package包/类
@Override
public MainViewController onCreateViewHolder(ViewGroup parent, int viewType) {
    MainViewController holder = createEmptyView();
    switch (viewType) {
        case R.id.whats_new:
            holder.bindWhatsNewView();
            break;
        case R.id.categories:
            holder.bindCategoriesView();
            break;
        case R.id.nearby:
            holder.bindSwapView();
            break;
        case R.id.updates:
            // Hold of until onViewAttachedToWindow, because that is where we want to start listening
            // for broadcast events (which is what the data binding does).
            break;
        case R.id.settings:
            holder.bindSettingsView();
            break;
        default:
            throw new IllegalStateException("Unknown view type " + viewType);
    }
    return holder;
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:26,代码来源:MainViewAdapter.java


示例12: onFinishInflate

import org.fdroid.fdroid.R; //导入依赖的package包/类
@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    ((TextView) findViewById(R.id.heading)).setText(R.string.swap_connecting);
    findViewById(R.id.back).setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            getActivity().showIntro();
        }
    });

    LocalBroadcastManager.getInstance(getActivity()).registerReceiver(
            repoUpdateReceiver, new IntentFilter(UpdateService.LOCAL_ACTION_STATUS));
    LocalBroadcastManager.getInstance(getActivity()).registerReceiver(
            prepareSwapReceiver, new IntentFilter(SwapWorkflowActivity.PrepareSwapRepo.ACTION));
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:18,代码来源:SwapConnecting.java


示例13: getInstalledStatus

import org.fdroid.fdroid.R; //导入依赖的package包/类
private String getInstalledStatus(final Apk apk) {
    // Definitely not installed.
    if (apk.versionCode != app.installedVersionCode) {
        return context.getString(R.string.app_not_installed);
    }
    // Definitely installed this version.
    if (apk.sig != null && apk.sig.equals(app.installedSig)) {
        return context.getString(R.string.app_installed);
    }
    // Installed the same version, but from someplace else.
    final String installerPkgName;
    try {
        installerPkgName = context.getPackageManager().getInstallerPackageName(app.packageName);
    } catch (IllegalArgumentException e) {
        Log.w("AppDetailsAdapter", "Application " + app.packageName + " is not installed anymore");
        return context.getString(R.string.app_not_installed);
    }
    if (TextUtils.isEmpty(installerPkgName)) {
        return context.getString(R.string.app_inst_unknown_source);
    }
    final String installerLabel = InstalledAppProvider
            .getApplicationLabel(context, installerPkgName);
    return context.getString(R.string.app_inst_known_source, installerLabel);
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:25,代码来源:AppDetailsRecyclerViewAdapter.java


示例14: onFinishInflate

import org.fdroid.fdroid.R; //导入依赖的package包/类
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    setUIFromWifi();

    ImageView qrImage = (ImageView) findViewById(R.id.wifi_qr_code);

    // Replace all blacks with the background blue.
    qrImage.setColorFilter(new LightingColorFilter(0xffffffff, getResources().getColor(R.color.swap_blue)));

    Button openQr = (Button) findViewById(R.id.btn_qr_scanner);
    openQr.setOnClickListener(new Button.OnClickListener() {
        @Override
        public void onClick(View v) {
            getActivity().initiateQrScan();
        }
    });

    LocalBroadcastManager.getInstance(getActivity()).registerReceiver(
            onWifiStateChanged, new IntentFilter(WifiStateChangeService.BROADCAST));
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:22,代码来源:WifiQrView.java


示例15: prepareNfcMenuItems

import org.fdroid.fdroid.R; //导入依赖的package包/类
@TargetApi(16)
private void prepareNfcMenuItems(Menu menu) {
    NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);
    MenuItem menuItem = menu.findItem(R.id.menu_enable_nfc);

    if (nfcAdapter == null) {
        menuItem.setVisible(false);
        return;
    }

    boolean needsEnableNfcMenuItem;
    if (Build.VERSION.SDK_INT < 16) {
        needsEnableNfcMenuItem = !nfcAdapter.isEnabled();
    } else {
        needsEnableNfcMenuItem = !nfcAdapter.isNdefPushEnabled();
    }

    menuItem.setVisible(needsEnableNfcMenuItem);
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:20,代码来源:RepoDetailsActivity.java


示例16: setupRepoFingerprint

import org.fdroid.fdroid.R; //导入依赖的package包/类
private void setupRepoFingerprint(View parent, Repo repo) {
    TextView repoFingerprintView = (TextView) parent.findViewById(R.id.text_repo_fingerprint);
    TextView repoFingerprintDescView = (TextView) parent.findViewById(R.id.text_repo_fingerprint_description);

    String repoFingerprint;

    // TODO show the current state of the signature check, not just whether there is a key or not
    if (TextUtils.isEmpty(repo.fingerprint) && TextUtils.isEmpty(repo.signingCertificate)) {
        repoFingerprint = getResources().getString(R.string.unsigned);
        repoFingerprintView.setTextColor(getResources().getColor(R.color.unsigned));
        repoFingerprintDescView.setVisibility(View.VISIBLE);
        repoFingerprintDescView.setText(getResources().getString(R.string.unsigned_description));
    } else {
        // this is based on repo.fingerprint always existing, which it should
        repoFingerprint = Utils.formatFingerprint(this, repo.fingerprint);
        repoFingerprintDescView.setVisibility(View.GONE);
    }

    repoFingerprintView.setText(repoFingerprint);
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:21,代码来源:RepoDetailsActivity.java


示例17: onCreate

import org.fdroid.fdroid.R; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // The server should not be doing anything or occupying any (noticeable) resources
    // until we actually ask it to enable swapping. Therefore, we will start it nice and
    // early so we don't have to wait until it is connected later.
    Intent service = new Intent(this, SwapService.class);
    if (bindService(service, serviceConnection, Context.BIND_AUTO_CREATE)) {
        startService(service);
    }

    setContentView(R.layout.swap_activity);

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitleTextAppearance(getApplicationContext(), R.style.SwapTheme_Wizard_Text_Toolbar);
    setSupportActionBar(toolbar);

    container = (ViewGroup) findViewById(R.id.fragment_container);

    localBroadcastManager = LocalBroadcastManager.getInstance(this);

    new SwapDebug().logStatus();
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:25,代码来源:SwapWorkflowActivity.java


示例18: updateCheckedIndicatorView

import org.fdroid.fdroid.R; //导入依赖的package包/类
private void updateCheckedIndicatorView(View view, boolean checked) {
    ImageView imageView = (ImageView) view.findViewById(R.id.checked);
    if (imageView != null) {
        int resource;
        int colour;
        if (checked) {
            resource = R.drawable.ic_check_circle_white;
            colour = getResources().getColor(R.color.swap_bright_blue);
        } else {
            resource = R.drawable.ic_add_circle_outline_white;
            colour = 0xFFD0D0D4;
        }
        imageView.setImageDrawable(getResources().getDrawable(resource));
        imageView.setColorFilter(colour, PorterDuff.Mode.MULTIPLY);
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:17,代码来源:SelectAppsView.java


示例19: CategoryController

import org.fdroid.fdroid.R; //导入依赖的package包/类
CategoryController(final Activity activity, LoaderManager loaderManager, View itemView) {
    super(itemView);

    this.activity = activity;
    this.loaderManager = loaderManager;

    appCardsAdapter = new AppPreviewAdapter(activity);

    viewAll = (Button) itemView.findViewById(R.id.button);
    viewAll.setOnClickListener(onViewAll);

    heading = (TextView) itemView.findViewById(R.id.name);
    image = (FeatureImage) itemView.findViewById(R.id.category_image);
    background = (FrameLayout) itemView.findViewById(R.id.category_background);

    RecyclerView appCards = (RecyclerView) itemView.findViewById(R.id.app_cards);
    appCards.setAdapter(appCardsAdapter);
    appCards.addItemDecoration(new ItemDecorator(activity));

    displayImageOptions = new DisplayImageOptions.Builder()
            .cacheInMemory(true)
            .imageScaleType(ImageScaleType.NONE)
            .displayer(new FadeInBitmapDisplayer(100, true, true, false))
            .bitmapConfig(Bitmap.Config.RGB_565)
            .build();
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:27,代码来源:CategoryController.java


示例20: bindModel

import org.fdroid.fdroid.R; //导入依赖的package包/类
void bindModel(@NonNull String categoryName) {
    currentCategory = categoryName;

    String translatedName = translateCategory(activity, categoryName);
    heading.setText(translatedName);
    heading.setContentDescription(activity.getString(R.string.tts_category_name, translatedName));

    viewAll.setVisibility(View.INVISIBLE);

    loaderManager.initLoader(currentCategory.hashCode(), null, this);
    loaderManager.initLoader(currentCategory.hashCode() + 1, null, this);

    @ColorInt int backgroundColour = getBackgroundColour(activity, categoryName);
    background.setBackgroundColor(backgroundColour);

    int categoryImageId = getCategoryResource(activity, categoryName, "drawable", true);
    if (categoryImageId == 0) {
        image.setColour(backgroundColour);
        image.setImageDrawable(null);
    } else {
        image.setColour(ContextCompat.getColor(activity, R.color.fdroid_blue));
        ImageLoader.getInstance().displayImage("drawable://" + categoryImageId, image, displayImageOptions);
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:25,代码来源:CategoryController.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Pair类代码示例发布时间:2022-05-22
下一篇:
Java ClientType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap