Search in sources :

Example 66 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project fdroidclient by f-droid.

the class SettingsView method onDetachedFromWindow.

@Override
protected void onDetachedFromWindow() {
    super.onDetachedFromWindow();
    AppCompatActivity activity = (AppCompatActivity) getContext();
    Fragment existingFragment = activity.getSupportFragmentManager().findFragmentByTag("preferences-fragment");
    if (existingFragment == null) {
        return;
    }
    if (currentTransaction == null) {
        currentTransaction = activity.getSupportFragmentManager().beginTransaction();
    }
    currentTransaction.remove(existingFragment);
    currentTransaction.commitAllowingStateLoss();
    currentTransaction = null;
    activity.getSupportFragmentManager().executePendingTransactions();
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) PreferencesFragment(org.fdroid.fdroid.views.PreferencesFragment) Fragment(androidx.fragment.app.Fragment)

Example 67 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project fdroidclient by f-droid.

the class SettingsView method onAttachedToWindow.

@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    AppCompatActivity activity = (AppCompatActivity) getContext();
    if (currentTransaction == null) {
        currentTransaction = activity.getSupportFragmentManager().beginTransaction();
    }
    currentTransaction.replace(getId(), new PreferencesFragment(), "preferences-fragment");
    currentTransaction.commitAllowingStateLoss();
    currentTransaction = null;
    activity.getSupportFragmentManager().executePendingTransactions();
}
Also used : PreferencesFragment(org.fdroid.fdroid.views.PreferencesFragment) AppCompatActivity(androidx.appcompat.app.AppCompatActivity)

Example 68 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project Taskbar by farmerbb.

the class AppearanceFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    AppCompatActivity activity = (AppCompatActivity) getActivity();
    activity.setTitle(R.string.tb_pref_header_appearance);
    ActionBar actionBar = activity.getSupportActionBar();
    if (actionBar != null)
        actionBar.setDisplayHomeAsUpEnabled(true);
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar)

Example 69 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project Taskbar by farmerbb.

the class FreeformModeFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    AppCompatActivity activity = (AppCompatActivity) getActivity();
    activity.setTitle(R.string.tb_pref_header_freeform);
    ActionBar actionBar = activity.getSupportActionBar();
    if (actionBar != null)
        actionBar.setDisplayHomeAsUpEnabled(true);
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar)

Example 70 with AppCompatActivity

use of androidx.appcompat.app.AppCompatActivity in project Taskbar by farmerbb.

the class ManageAppDataFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    AppCompatActivity activity = (AppCompatActivity) getActivity();
    activity.setTitle(R.string.tb_manage_app_data);
    ActionBar actionBar = activity.getSupportActionBar();
    if (actionBar != null)
        actionBar.setDisplayHomeAsUpEnabled(true);
}
Also used : AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ActionBar(androidx.appcompat.app.ActionBar)

Aggregations

AppCompatActivity (androidx.appcompat.app.AppCompatActivity)74 ActionBar (androidx.appcompat.app.ActionBar)22 Toolbar (androidx.appcompat.widget.Toolbar)19 View (android.view.View)18 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)10 RecyclerView (androidx.recyclerview.widget.RecyclerView)7 Intent (android.content.Intent)6 TextView (android.widget.TextView)6 Fragment (androidx.fragment.app.Fragment)6 Activity (android.app.Activity)5 Bundle (android.os.Bundle)5 BindView (butterknife.BindView)5 LayoutInflater (android.view.LayoutInflater)4 ImageView (android.widget.ImageView)4 ScrollView (android.widget.ScrollView)4 List (java.util.List)4 Nullable (androidx.annotation.Nullable)3 TargetApi (android.annotation.TargetApi)2 Dialog (android.app.Dialog)2 SharedPreferences (android.content.SharedPreferences)2