Java Code Examples for androidx.fragment.app.FragmentActivity#getResources()

The following examples show how to use androidx.fragment.app.FragmentActivity#getResources() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SeasonsAdapter.java    From cathode with Apache License 2.0 6 votes vote down vote up
public SeasonsAdapter(FragmentActivity activity, SeasonClickListener clickListener,
    LibraryType type) {
  super(activity);
  this.activity = activity;
  resources = activity.getResources();
  this.clickListener = clickListener;
  this.type = type;
  setHasStableIds(true);

  TypedArray a = activity.obtainStyledAttributes(new int[] {
      android.R.attr.textColorPrimary, android.R.attr.textColorSecondary,
  });
  primaryColor = a.getColorStateList(0);
  //noinspection ResourceType
  secondaryColor = a.getColorStateList(1);
  a.recycle();
}
 
Example 2
Source File: SeasonAdapter.java    From cathode with Apache License 2.0 5 votes vote down vote up
public SeasonAdapter(FragmentActivity activity, EpisodeCallbacks callbacks, LibraryType type) {
  super(activity);
  this.activity = activity;
  this.callbacks = callbacks;
  this.type = type;
  resources = activity.getResources();
  setHasStableIds(true);
}