Java Code Examples for android.support.annotation.XmlRes

The following are top voted examples for showing how to use android.support.annotation.XmlRes. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: IO_Classic_WatchFace   File: SettingsFragment.java   View source code 6 votes vote down vote up
@Override
public void addPreferencesFromResource(@XmlRes int preferencesResId) {
    super.addPreferencesFromResource(preferencesResId);

    Executor executor = (runnable) -> new Thread(runnable).start();

    ProviderInfoRetriever.OnProviderInfoReceivedCallback callback = new ProviderInfoRetriever.OnProviderInfoReceivedCallback() {
        @Override
        public void onProviderInfoReceived(int i, @Nullable ComplicationProviderInfo complicationProviderInfo) {
            setComplicationSummary(i, complicationProviderInfo);
        }
    };

    mProviderInfoRetriever = new ProviderInfoRetriever(mContext, executor);

    mProviderInfoRetriever.init();
    mProviderInfoRetriever.retrieveProviderInfo(callback,
            new ComponentName(mContext, IOClassicWatchFaceService.class),
            IOClassicWatchFaceService.COMPLICATION_IDS);
}
 
Example 2
Project: Capsule   File: ChangelogDialog.java   View source code 6 votes vote down vote up
/**
 * Setup for ChangelogDialog
 *
 * @param activity        activity for context
 * @param xmlRes          xmlRes of Changelog file
 * @param neutralCallback optional callback & string for neutral button
 */
public static void show(@NonNull final FragmentActivity activity, @XmlRes final int xmlRes,
                        @Nullable final OnChangelogNeutralButtonClick neutralCallback) {
    final Handler mHandler = new Handler();
    new Thread(new Runnable() {
        @Override
        public void run() {
            final ArrayList<ChangelogXmlParser.ChangelogItem> items = ChangelogXmlParser
                    .parse(activity, xmlRes);
            mHandler.post(new TimerTask() {
                @Override
                public void run() {
                    ChangelogDialog f = new ChangelogDialog()
                            .setNeutralCallback(neutralCallback);
                    if (!items.isEmpty()) {
                        Bundle args = new Bundle();
                        args.putParcelableArrayList(ITEM_TAG, items);
                        f.setArguments(args);
                    }
                    f.show(activity.getSupportFragmentManager(), DIALOG_TAG);
                }
            });
        }
    }).start();
}
 
Example 3
Project: MaterialPreference   File: PreferenceFragment.java   View source code 6 votes vote down vote up
/**
 * Inflates the given XML resource and replaces the current preference hierarchy (if any) with
 * the preference hierarchy rooted at {@code key}.
 *
 * @param preferencesResId The XML resource ID to inflate.
 * @param key The preference key of the {@link PreferenceScreen} to use as the root of the
 *            preference hierarchy, or null to use the root {@link PreferenceScreen}.
 */
public void setPreferencesFromResource(@XmlRes int preferencesResId, @Nullable String key) {
    requirePreferenceManager();

    final PreferenceScreen xmlRoot = mPreferenceManager.inflateFromResource(mStyledContext,
            preferencesResId, null);

    final Preference root;
    if (key != null) {
        root = xmlRoot.findPreference(key);
        if (!(root instanceof PreferenceScreen)) {
            throw new IllegalArgumentException("Preference object with key " + key
                    + " is not a PreferenceScreen");
        }
    } else {
        root = xmlRoot;
    }

    setPreferenceScreen((PreferenceScreen) root);
}
 
Example 4
Project: android-52Kit   File: Winds.java   View source code 6 votes vote down vote up
/**
 * Draft a changelog recycler view ready to be displayed
 *
 * @param ctx           the context to construct the view with
 * @param configId      the xml configuration resource id
 * @return              the built RecyclerView ready for insertion
 */
public static RecyclerView draft(Context ctx, @XmlRes int configId){

    // Parse config
    ChangeLog changeLog = Parser.parse(ctx, configId);

    // Setup the adapter
    ChangeLogAdapter adapter = new ChangeLogAdapter();
    adapter.setChangeLog(changeLog);

    // Parse the configuration from the resource ID and generate a RecyclerView that is ready to go
    RecyclerView recycler = new RecyclerView(ctx);
    recycler.setAdapter(adapter);
    recycler.setLayoutManager(new LinearLayoutManager(ctx));
    recycler.setItemAnimator(new DefaultItemAnimator());
    recycler.addItemDecoration(new StickyRecyclerHeadersElevationDecoration(adapter));

    return recycler;
}
 
Example 5
Project: android-52Kit   File: Winds.java   View source code 6 votes vote down vote up
/**
 * Check to see if we should show the changelog activity if there are any new changes
 * to the configuration file.
 *
 * @param ctx           the context to launch the activity with
 * @param configId      the changelog configuration xml resource id
 */
public static void checkChangelogActivity(Context ctx, @XmlRes int configId){

    // Parse configuration
    ChangeLog changeLog = Parser.parse(ctx, configId);
    if(changeLog != null){

        // Validate that there is a new version code
        if(validateVersion(ctx, changeLog)) {
            openChangelogActivity(ctx, configId);
        }

    }else{
        throw new NullPointerException("Unable to find a 'Winds' configuration @ " + configId);
    }

}
 
Example 6
Project: android-52Kit   File: Winds.java   View source code 6 votes vote down vote up
/**
 * Check to see if we should show the changelog activity if there are any new changes
 * to the configuration file.
 *
 * @param ctx           the context to launch the activity with
 * @param configId      the changelog configuration xml resource id
 */
public static void checkChangelogDialog(Activity ctx, @XmlRes int configId){

    // Parse configuration
    ChangeLog changeLog = Parser.parse(ctx, configId);
    if(changeLog != null){

        // Validate that there is a new version code
        if(validateVersion(ctx, changeLog)) {
            openChangelogDialog(ctx, configId);
        }

    }else{
        throw new NullPointerException("Unable to find a 'Winds' configuration @ " + configId);
    }

}
 
Example 7
Project: ReminderDatePicker   File: PickerSpinner.java   View source code 6 votes vote down vote up
/**
 *
 */
protected ArrayList<TwinTextItem> getItemsFromXml(@XmlRes int xmlResource)
        throws XmlPullParserException, IOException {
    final Resources res = getResources();
    XmlResourceParser parser = res.getXml(xmlResource);
    ArrayList<TwinTextItem> items = new ArrayList<>();

    int eventType;
    while((eventType = parser.next()) != XmlPullParser.END_DOCUMENT) {
        if(eventType == XmlPullParser.START_TAG) {
            // call our subclass to parse the correct item
            TwinTextItem item = parseItemFromXmlTag(parser);
            if(item != null)
                items.add(item);
        }
    }

    return items;
}
 
Example 8
Project: YourAppIdea   File: EulaChangeLogChainHelper.java   View source code 6 votes vote down vote up
public static void show(FragmentActivity fragmentActivity,
                        @StringRes int resEulaTitle,
                        @StringRes int resEulaAcceptLabel,
                        @StringRes int resEulaRefuseLabel,
                        @StringRes int resChangeLogTitle,
                        @StringRes int resChangeLogClose,
                        @XmlRes int resChangeLog) {
    //not shown = already accepted
    boolean shown = EulaHelper.showAcceptRefuse(fragmentActivity, resEulaTitle, resEulaAcceptLabel, resEulaRefuseLabel);

    ChangeLogHelper changeLogHelper = new ChangeLogHelper();
    if (!shown) {
        changeLogHelper.showWhatsNew(resChangeLogTitle, resChangeLogClose, resChangeLog, fragmentActivity);
    } else {
        //We don't show the changelog at first run of the first install, but we have to save the current version
        //for the future upgrades
        changeLogHelper.saveCurrentVersion(fragmentActivity);
    }
}
 
Example 9
Project: SkinFramework   File: ComposedResources.java   View source code 5 votes vote down vote up
@Override
public XmlResourceParser getXml(@XmlRes int id) throws NotFoundException {
    int realId = getCorrespondResIdStrictly(id);
    if (realId > 0) {
        return mSkinResources.getXml(realId);
    }
    return super.getXml(id);
}
 
Example 10
Project: QiangHongBao   File: BottomBar.java   View source code 5 votes vote down vote up
/**
 * Set the item for the BottomBar from XML Resource with a default configuration
 * for each tab.
 */
public void setItems(@XmlRes int xmlRes, BottomBarTab.Config defaultTabConfig) {
    if (xmlRes == 0) {
        throw new RuntimeException("No items specified for the BottomBar!");
    }

    if (defaultTabConfig == null) {
        defaultTabConfig = getTabConfig();
    }

    TabParser parser = new TabParser(getContext(), defaultTabConfig, xmlRes);
    updateItems(parser.getTabs());
}
 
Example 11
Project: QiangHongBao   File: TabParser.java   View source code 5 votes vote down vote up
TabParser(Context context, BottomBarTab.Config defaultTabConfig, @XmlRes int tabsXmlResId) {
    this.context = context;
    this.defaultTabConfig = defaultTabConfig;

    parser = context.getResources().getXml(tabsXmlResId);
    tabs = new ArrayList<>();

    parse();
}
 
Example 12
Project: Programmers   File: SettingsFragment.java   View source code 5 votes vote down vote up
/**
 * Method do get an instance of the Fragment
 * Needed to reuse.
 *
 * @param category_xml the XML file to load in UI
 * @return SettingsFragment
 */
public static SettingsFragment newInstance(@XmlRes int category_xml) {
    SettingsFragment instance = new SettingsFragment();
    Bundle b = new Bundle();
    b.putInt(Presenter.CATEGORY, category_xml);
    instance.setArguments(b);
    return instance;
}
 
Example 13
Project: Programmers   File: SettingsFragment.java   View source code 5 votes vote down vote up
/**
 * To replace the current fragment, with new xml to show.
 *
 * @param resid the xml UI to show in the fragment
 */
@Override
public void replaceFragment(@XmlRes int resid) {

    Fragment fragment = SettingsFragment.newInstance(resid);
    getFragmentManager()
            .beginTransaction()
            .addToBackStack(null)
            .replace(R.id.frame_layout, fragment, Contract.Presenter.CATEGORY_TAG)
            .commit();
}
 
Example 14
Project: Tusky   File: PreferencesActivity.java   View source code 5 votes vote down vote up
public void showFragment(@XmlRes int preferenceId, @StringRes int title) {

        //TODO: cache the Fragments so they can be reused
        getFragmentManager().beginTransaction()
                .replace(R.id.fragment_container, PreferencesFragment.newInstance(preferenceId))
                .commit();

        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setTitle(title);
        }

        currentPreferences = preferenceId;
        currentTitle = title;
    }
 
Example 15
Project: BottomBar   File: BottomBar.java   View source code 5 votes vote down vote up
/**
 * Set the item for the BottomBar from XML Resource with a default configuration
 * for each tab.
 */
public void setItems(@XmlRes int xmlRes, BottomBarTab.Config defaultTabConfig) {
    if (xmlRes == 0) {
        throw new RuntimeException("No items specified for the BottomBar!");
    }

    if (defaultTabConfig == null) {
        defaultTabConfig = getTabConfig();
    }

    TabParser parser = new TabParser(getContext(), defaultTabConfig, xmlRes);
    updateItems(parser.parseTabs());
}
 
Example 16
Project: wearDrip   File: XmlPreferenceParser.java   View source code 5 votes vote down vote up
@NonNull
WearPreferenceScreen parse(@NonNull final Context context, @XmlRes final int prefsResId) {
    try {
        final XmlResourceParser parser = context.getResources().getXml(prefsResId);
        return parseScreen(context, parser);
    } catch (XmlPullParserException | IOException e) {
        throw new RuntimeException("Error parsing preferences file", e);
    }
}
 
Example 17
Project: PluginM   File: PluginPackageManager.java   View source code 5 votes vote down vote up
@Override
public XmlResourceParser getXml(String packageName, @XmlRes int resid, ApplicationInfo appInfo) {
    Resources pluginResource = getPluginResouces(packageName);
    if (pluginResource != null) {
        return pluginResource.getXml(resid);
    }
    return mBase.getXml(packageName, resid, appInfo);
}
 
Example 18
Project: material-components-android   File: ChipDrawable.java   View source code 5 votes vote down vote up
/**
 * Returns a ChipDrawable from the given XML resource. All attributes from {@link
 * R.styleable#ChipDrawable} and a custom <code>style</code> attribute are supported. A chip
 * resource may look like:
 *
 * <pre>{@code
 * <chip
 *     xmlns:app="http://schemas.android.com/apk/res-auto"
 *     style="@style/Widget.MaterialComponents.Chip.Entry"
 *     app:chipIcon="@drawable/custom_icon"/>
 * }</pre>
 */
public static ChipDrawable createFromResource(Context context, @XmlRes int id) {
  try {
    XmlPullParser parser = context.getResources().getXml(id);

    int type;
    do {
      type = parser.next();
    } while (type != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT);
    if (type != XmlPullParser.START_TAG) {
      throw new XmlPullParserException("No start tag found");
    }

    if (!TextUtils.equals(parser.getName(), "chip")) {
      throw new XmlPullParserException("Must have a <chip> start tag");
    }

    AttributeSet attrs = Xml.asAttributeSet(parser);
    @StyleRes int style = attrs.getStyleAttribute();
    if (style == 0) {
      style = R.style.Widget_MaterialComponents_Chip_Entry;
    }

    return createFromAttributes(context, attrs, R.attr.chipStandaloneStyle, style);
  } catch (XmlPullParserException | IOException e) {
    Resources.NotFoundException exception =
        new NotFoundException("Can't load chip resource ID #0x" + Integer.toHexString(id));
    exception.initCause(e);
    throw exception;
  }
}
 
Example 19
Project: polar-dashboard   File: DrawableXmlParser.java   View source code 5 votes vote down vote up
public static List<Category> parse(@NonNull Context context, @XmlRes int xmlRes) {
  mCategories = new ArrayList<>();
  XmlResourceParser parser = null;
  try {
    parser = context.getResources().getXml(xmlRes);
    int eventType = parser.getEventType();
    while (eventType != XmlPullParser.END_DOCUMENT) {
      switch (eventType) {
        case XmlPullParser.START_TAG:
          final String tagName = parser.getName();
          if (tagName.equalsIgnoreCase("category")) {
            mCurrentCategory = new Category(parser.getAttributeValue(null, "title"));
            mCategories.add(mCurrentCategory);
          } else if (tagName.equalsIgnoreCase("item")) {
            if (mCurrentCategory == null) {
              mCurrentCategory = new Category(context.getString(R.string.default_category));
              mCategories.add(mCurrentCategory);
            }
            mCurrentCategory.addItem(
                new Icon(parser.getAttributeValue(null, "drawable"), mCurrentCategory));
          }
          break;
      }
      eventType = parser.next();
    }

  } catch (XmlPullParserException | IOException e) {
    e.printStackTrace();
  } finally {
    if (parser != null) {
      parser.close();
    }
  }

  mCurrentCategory = null;
  return mCategories;
}
 
Example 20
Project: ticdesign   File: PreferenceFragment.java   View source code 5 votes vote down vote up
/**
 * Inflates the given XML resource and adds the preference hierarchy to the current
 * preference hierarchy.
 *
 * @param preferencesResId The XML resource ID to inflate.
 */
public void addPreferencesFromResource(@XmlRes int preferencesResId) {
    requirePreferenceManager();

    setPreferenceScreen(mPreferenceManager.inflateFromResource(getActivity(),
            preferencesResId, getPreferenceScreen()));
}
 
Example 21
Project: MaterialPreference   File: PreferenceFragment.java   View source code 5 votes vote down vote up
/**
 * Inflates the given XML resource and adds the preference hierarchy to the current
 * preference hierarchy.
 *
 * @param preferencesResId The XML resource ID to inflate.
 */
public void addPreferencesFromResource(@XmlRes int preferencesResId) {
    requirePreferenceManager();

    setPreferenceScreen(mPreferenceManager.inflateFromResource(mStyledContext,
            preferencesResId, getPreferenceScreen()));
}
 
Example 22
Project: android-52Kit   File: ChangeLogDialog.java   View source code 5 votes vote down vote up
public static ChangeLogDialog createInstance(@XmlRes int configResId){
    ChangeLogDialog dialog = new ChangeLogDialog();
    Bundle args = new Bundle();
    args.putInt(EXTRA_CONFIG, configResId);
    dialog.setArguments(args);
    return dialog;
}
 
Example 23
Project: WearPreferenceActivity   File: XmlPreferenceParser.java   View source code 5 votes vote down vote up
@NonNull
WearPreferenceScreen parse(@NonNull final Context context, @XmlRes final int prefsResId) {
    try {
        final XmlResourceParser parser = context.getResources().getXml(prefsResId);
        return parseScreen(context, parser);
    } catch (XmlPullParserException | IOException e) {
        throw new RuntimeException("Error parsing preferences file", e);
    }
}
 
Example 24
Project: 365browser   File: PreferenceUtils.java   View source code 5 votes vote down vote up
/**
 * A helper that is used to load preferences from XML resources without causing a
 * StrictModeViolation. See http://crbug.com/692125.
 *
 * @param preferenceFragment A PreferenceFragment.
 * @param preferencesResId   The id of the XML resource to add to the PreferenceFragment.
 */
public static void addPreferencesFromResource(
        PreferenceFragment preferenceFragment, @XmlRes int preferencesResId) {
    StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
    try {
        preferenceFragment.addPreferencesFromResource(preferencesResId);
    } finally {
        StrictMode.setThreadPolicy(oldPolicy);
    }
}
 
Example 25
Project: sprockets-android   File: SprocketsPreferenceFragment.java   View source code 5 votes vote down vote up
/**
 * Display the preferences and log changes in analytics.
 *
 * @since 2.6.0
 */
public static SprocketsPreferenceFragment newInstance(@XmlRes int prefs, boolean logChanges) {
    SprocketsPreferenceFragment frag = new SprocketsPreferenceFragment();
    Bundle args = Fragments.arguments(frag);
    args.putInt(PREFS, prefs);
    args.putBoolean(LOG_CHANGES, logChanges);
    return frag;
}
 
Example 26
Project: android_dbinspector   File: PreferenceListFragment.java   View source code 5 votes vote down vote up
public static PreferenceListFragment newInstance(@XmlRes int xmlId) {
    Bundle args = new Bundle();
    args.putInt(XML_ID, xmlId);
    PreferenceListFragment prefListFragment = new PreferenceListFragment();
    prefListFragment.setArguments(args);
    return prefListFragment;
}
 
Example 27
Project: SimpleWatchface   File: ColorPreset.java   View source code 5 votes vote down vote up
public static ColorPreset fromXml(Context context, @XmlRes int xmlResId) throws IOException, XmlPullParserException {
    ColorPreset res = new ColorPreset();
    XmlResourceParser xmlResourceParser = context.getResources().getXml(xmlResId);
    String name = null;
    int eventType;
    while ((eventType = xmlResourceParser.next()) != XmlPullParser.END_DOCUMENT) {
        switch (eventType) {
            case XmlPullParser.START_TAG:
                String tagName = xmlResourceParser.getName();
                if ("color".equals(tagName)) {
                    name = xmlResourceParser.getAttributeValue(null, "name");
                }
                break;

            case XmlPullParser.TEXT:
                String colorStr = xmlResourceParser.getText().trim();
                int color = Color.parseColor(colorStr);
                switch (name) {
                    case "background":
                        res.background = color;
                        break;
                    case "hourMinutes":
                        res.hourMinutes = color;
                        break;
                    case "seconds":
                        res.seconds = color;
                        break;
                    case "amPm":
                        res.amPm = color;
                        break;
                    case "date":
                        res.date = color;
                        break;
                }
        }
    }
    xmlResourceParser.close();

    return res;
}
 
Example 28
Project: PebbleDialer-Android   File: TaskerSettingsActivity.java   View source code 5 votes vote down vote up
public void switchToGenericPreferenceScreen(@XmlRes int xmlRes, String root)
{
    Fragment fragment = GenericPreferenceScreen.newInstance(xmlRes, root);
    getSupportFragmentManager()
            .beginTransaction()
            .addToBackStack(null)
            .replace(R.id.content_frame, fragment)
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
            .commit();
}
 
Example 29
Project: PebbleDialer-Android   File: GenericPreferenceScreen.java   View source code 5 votes vote down vote up
public static GenericPreferenceScreen newInstance(@XmlRes int preferenceXml, String root)
{
    Bundle arguments = new Bundle();
    arguments.putInt("PreferencesXML", preferenceXml);
    arguments.putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, root);

    GenericPreferenceScreen genericPreferenceScreen = new GenericPreferenceScreen();
    genericPreferenceScreen.setArguments(arguments);
    return genericPreferenceScreen;
}
 
Example 30
Project: PebbleDialer-Android   File: MainActivity.java   View source code 5 votes vote down vote up
public void switchToGenericPreferenceScreen(@XmlRes int xmlRes, String root)
{
    Fragment fragment = GenericPreferenceScreen.newInstance(xmlRes, root);
    getSupportFragmentManager()
            .beginTransaction()
            .addToBackStack(null)
            .replace(R.id.content_frame, fragment)
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
            .commit();
}
 
Example 31
Project: markor   File: GsPreferenceFragmentCompat.java   View source code 4 votes vote down vote up
@XmlRes
public abstract int getPreferenceResourceForInflation();
 
Example 32
Project: QiangHongBao   File: BottomBar.java   View source code 4 votes vote down vote up
/**
 * Set the items for the BottomBar from XML Resource.
 */
public void setItems(@XmlRes int xmlRes) {
    setItems(xmlRes, null);
}
 
Example 33
Project: Programmers   File: Presenter.java   View source code 4 votes vote down vote up
/**
 * Hadle here Preference Item click
 *
 * @param preference the preference that was clicked
 * @return true if the click was handled
 */
@Override
public boolean onPreferenceClick(Preference preference) {
    String key = preference.getKey() != null ? preference.getKey() : "";

    // Categories click
    @XmlRes int resid = 0;

    switch (key) {

        case CATEGORY_NOTIFICATIONS:
            resid = R.xml.settings_notifications;
            break;

        case CATEGORY_SHARE_APP:
            view.startShareAppIntent();
            break;

        case CATEGORY_CHANGE_PASSWORD:
            view.showResetPasswordFragment();
            break;

        case CATEGORY_UPDATES:
            resid = R.xml.settings_updates;
            break;

        case CATEGORY_PRIVACY_POLICE:
            view.startPrivacyPoliceActivity();
            break;

        case CATEGORY_ABOUT:
            resid = R.xml.settings_about;
            break;

        case CATEGORY_QUIT:
            // Logout user
            view.logout();
            break;
    }

    if (resid != 0) {
        view.replaceFragment(resid);
    }

    // Sub- categories click
    switch (key) {
        case FEEDBACK:

            String appEmail = getContext().getString(R.string.app_email);
            view.startActivityToSendMail(appEmail);
            break;

        case ON_FACEBOOK:
            IntentUtils.startAppOnFacebookIntent(getContext());
            break;

        case DONATE:
            view.startDonateActivity();
            break;

        case MORE_ABOUT_APP:
            view.startAboutAppActivity();
            break;
    }

    return false;
}
 
Example 34
Project: memetastic   File: GsPreferenceFragmentCompat.java   View source code 4 votes vote down vote up
@XmlRes
public abstract int getPreferenceResourceForInflation();
 
Example 35
Project: RxFireDroid   File: RxFireDroidRemoteConfig.java   View source code 4 votes vote down vote up
public static Completable setDefaults(@XmlRes int xmlRes) {
    return Completable.fromAction(() -> FirebaseRemoteConfig.getInstance().setDefaults(xmlRes))
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread());
}
 
Example 36
Project: RxFireDroid   File: RxFireDroidRemoteConfig.java   View source code 4 votes vote down vote up
public static Completable setDefaults(@XmlRes int xmlRes, @NonNull String namespace) {
    return Completable.fromAction(() ->
            FirebaseRemoteConfig.getInstance().setDefaults(xmlRes, namespace))
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread());
}
 
Example 37
Project: BottomBar   File: BottomBar.java   View source code 4 votes vote down vote up
/**
 * Set the items for the BottomBar from XML Resource.
 */
public void setItems(@XmlRes int xmlRes) {
    setItems(xmlRes, null);
}
 
Example 38
Project: BottomBar   File: TabParser.java   View source code 4 votes vote down vote up
TabParser(@NonNull Context context, @NonNull BottomBarTab.Config defaultTabConfig, @XmlRes int tabsXmlResId) {
    this.context = context;
    this.defaultTabConfig = defaultTabConfig;
    this.parser = context.getResources().getXml(tabsXmlResId);
}
 
Example 39
Project: Capsule   File: ChangelogDialog.java   View source code 4 votes vote down vote up
public static void show(@NonNull final FragmentActivity activity, @XmlRes final int xmlRes) {
    show(activity, xmlRes, null);
}
 
Example 40
Project: xowa_android   File: BasePreferenceLoader.java   View source code 4 votes vote down vote up
protected void loadPreferences(@XmlRes int id) {
    preferenceHost.addPreferencesFromResource(id);
}