mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
#1381 Support Action Bar and AndroidX Alert Dialog
This commit is contained in:
parent
550b8064d5
commit
6cf636271d
35 changed files with 56 additions and 36 deletions
|
@ -38,6 +38,7 @@ dependencies {
|
|||
implementation 'nl.dionsegijn:konfetti:1.2.2'
|
||||
implementation 'com.github.jinatonic.confetti:confetti:1.1.2'
|
||||
implementation 'com.google.android.play:core:1.8.3'
|
||||
implementation "com.google.android.material:material:1.2.1"
|
||||
}
|
||||
|
||||
android {
|
||||
|
@ -47,13 +48,14 @@ android {
|
|||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 175
|
||||
versionName "10.1b7"
|
||||
versionName "10.1dev"
|
||||
}
|
||||
compileOptions.with {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
android.buildFeatures.viewBinding = true
|
||||
android.buildFeatures.dataBinding = true
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
style="?itemBackground" >
|
||||
style="?layoutBackground" >
|
||||
|
||||
<com.newsblur.view.ProgressThrobber
|
||||
android:id="@+id/loading_throb"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
style="?itemBackground" >
|
||||
style="?layoutBackground" >
|
||||
|
||||
<EditText
|
||||
android:id="@+id/itemlist_search_query"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="?itemBackground"
|
||||
style="?layoutBackground"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<FrameLayout
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="?itemBackground"
|
||||
style="?layoutBackground"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
style="?itemBackground" >
|
||||
style="?layoutBackground" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/empty_view"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="?itemBackground"
|
||||
style="?layoutBackground"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
style="?itemBackground"
|
||||
style="?layoutBackground"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="10dp" >
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="?itemBackground"
|
||||
style="?layoutBackground"
|
||||
android:focusable="false">
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<attr name="feedRowNeutCountText" format="string" />
|
||||
<attr name="actionbarBackground" format="string" />
|
||||
<attr name="listBackground" format="string" />
|
||||
<attr name="itemBackground" format="string" />
|
||||
<attr name="layoutBackground" format="string" />
|
||||
<attr name="readingBackground" format="string" />
|
||||
<attr name="defaultText" format="string" />
|
||||
<attr name="linkText" format="string" />
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<color name="primary.light">@color/nb_green_gray91</color>
|
||||
<color name="primaryDark.light">@color/black</color>
|
||||
<color name="secondary.light">@color/newsblur_blue</color>
|
||||
|
||||
<color name="black">#000000</color>
|
||||
<color name="gray07">#121212</color>
|
||||
<color name="gray10">#1A1A1A</color>
|
||||
|
|
|
@ -20,7 +20,7 @@ public class AddFeedExternal extends NbActivity implements AddFeedFragment.AddFe
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityAddfeedexternalBinding.inflate(getLayoutInflater());
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ abstract public class FeedChooser extends NbActivity {
|
|||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
bindLayout();
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
setupList();
|
||||
loadFeeds();
|
||||
loadFolders();
|
||||
|
|
|
@ -58,7 +58,7 @@ public class Main extends NbActivity implements StateChangedListener, SwipeRefre
|
|||
binding = ActivityMainBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
getActionBar().hide();
|
||||
getSupportActionBar().hide();
|
||||
|
||||
// set the status bar to an generic loading message when the activity is first created so
|
||||
// that something is displayed while the service warms up
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.newsblur.activity;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.text.TextUtils;
|
||||
|
@ -10,6 +9,7 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.newsblur.R;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.newsblur.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -15,7 +17,7 @@ import java.util.ArrayList;
|
|||
* The base class for all Activities in the NewsBlur app. Handles enforcement of
|
||||
* login state and tracking of sync/update broadcasts.
|
||||
*/
|
||||
public class NbActivity extends FragmentActivity {
|
||||
public class NbActivity extends AppCompatActivity {
|
||||
|
||||
public static final int UPDATE_DB_READY = (1<<0);
|
||||
public static final int UPDATE_METADATA = (1<<1);
|
||||
|
|
|
@ -28,7 +28,7 @@ public class Profile extends NbActivity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_profile);
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
apiManager = new APIManager(this);
|
||||
if (savedInstanceState == null) {
|
||||
userId = getIntent().getStringExtra(USER_ID);
|
||||
|
|
|
@ -46,7 +46,7 @@ public class SearchForFeeds extends NbActivity implements LoaderCallbacks<Search
|
|||
@Override
|
||||
protected void onCreate(Bundle arg0) {
|
||||
super.onCreate(arg0);
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
setTitle(R.string.title_feed_search);
|
||||
setContentView(R.layout.activity_feed_search);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.newsblur.activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
|
@ -10,7 +11,7 @@ import com.newsblur.util.PrefConstants;
|
|||
import com.newsblur.util.PrefsUtils;
|
||||
import com.newsblur.util.UIUtils;
|
||||
|
||||
public class Settings extends FragmentActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
public class Settings extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -18,7 +19,7 @@ public class Settings extends FragmentActivity implements SharedPreferences.OnSh
|
|||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
SettingsFragment fragment = new SettingsFragment();
|
||||
getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import com.newsblur.R;
|
||||
|
|
|
@ -6,10 +6,11 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
|
@ -11,10 +11,11 @@ import com.newsblur.util.FeedUtils;
|
|||
import com.newsblur.util.UIUtils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
public class DeleteFeedFragment extends DialogFragment {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.text.TextUtils;
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
|
|
@ -4,10 +4,11 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import com.newsblur.R;
|
||||
|
@ -14,7 +15,7 @@ public class LogoutDialogFragment extends DialogFragment {
|
|||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
builder.setMessage(getResources().getString(R.string.logout_warning));
|
||||
builder.setTitle(getResources().getString(R.string.logout_warning));
|
||||
builder.setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
|
|
|
@ -3,10 +3,11 @@ package com.newsblur.fragment;
|
|||
import com.newsblur.util.FeedUtils;
|
||||
import com.newsblur.util.ReadingAction;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
public class ReadingActionConfirmationFragment extends DialogFragment {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -16,6 +15,7 @@ import android.os.AsyncTask;
|
|||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import com.newsblur.R;
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package com.newsblur.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
|
@ -3,10 +3,11 @@ package com.newsblur.fragment;
|
|||
import java.util.Map;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import android.text.InputType;
|
||||
import android.text.TextUtils;
|
||||
|
|
Loading…
Add table
Reference in a new issue