Migration to AndroidX

This commit is contained in:
Caesar2011
2018-10-19 00:25:50 +02:00
parent 18ce71cb87
commit f86ee2ddf3
58 changed files with 300 additions and 239 deletions

2
.idea/misc.xml generated
View File

@@ -25,5 +25,5 @@
</value> </value>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" /> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (2)" project-jdk-type="JavaSDK" />
</project> </project>

View File

@@ -9,7 +9,7 @@ android {
targetSdkVersion 28 targetSdkVersion 28
versionCode 3 versionCode 3
versionName "1.1.1" versionName "1.1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
release { release {
@@ -27,24 +27,24 @@ android {
dependencies { dependencies {
implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-beta02', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.android.support:preference-v7:28.0.0' implementation 'androidx.preference:preference:1.0.0'
implementation 'com.android.support:design:28.0.0' implementation 'com.google.android.material:material:1.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'com.android.volley:volley:1.0.0' implementation 'com.android.volley:volley:1.1.0'
//noinspection GradleDependency //noinspection GradleDependency
implementation 'com.google.android.gms:play-services-auth:15.0.0' implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.android.support:support-v4:28.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
implementation 'com.android.support:support-v4:28.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'org.jetbrains:annotations-java5:15.0' implementation 'org.jetbrains:annotations-java5:15.0'
//implementation 'com.github.quivr:android-week-view:2.0.2'//com.github.alamkanak:android-week-view:1.2.6 //implementation 'com.github.quivr:android-week-view:2.0.2'//com.github.alamkanak:android-week-view:1.2.6
implementation 'com.ms-square:expandableTextView:0.1.4' implementation 'com.ms-square:expandableTextView:0.1.4'

View File

@@ -2,24 +2,25 @@ package de.sebse.fuplanner;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import com.google.android.material.navigation.NavigationView;
import java.util.Iterator; import java.util.Iterator;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import de.sebse.fuplanner.fragments.CanteensFragment; import de.sebse.fuplanner.fragments.CanteensFragment;
import de.sebse.fuplanner.fragments.LoginFragment; import de.sebse.fuplanner.fragments.LoginFragment;
import de.sebse.fuplanner.fragments.ModulesFragment; import de.sebse.fuplanner.fragments.ModulesFragment;

View File

@@ -1,11 +1,11 @@
package de.sebse.fuplanner.fragments; package de.sebse.fuplanner.fragments;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.fragments.CanteensFragment.OnCanteensFragmentInteractionListener; import de.sebse.fuplanner.fragments.CanteensFragment.OnCanteensFragmentInteractionListener;
import de.sebse.fuplanner.services.Canteen.types.Canteen; import de.sebse.fuplanner.services.Canteen.types.Canteen;

View File

@@ -2,15 +2,15 @@ package de.sebse.fuplanner.fragments;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.Canteen.CanteenBrowser; import de.sebse.fuplanner.services.Canteen.CanteenBrowser;

View File

@@ -3,8 +3,6 @@ package de.sebse.fuplanner.fragments;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -13,6 +11,8 @@ import android.widget.EditText;
import java.io.IOException; import java.io.IOException;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.GoogleAuth.GoogleAuth; import de.sebse.fuplanner.services.GoogleAuth.GoogleAuth;

View File

@@ -1,11 +1,11 @@
package de.sebse.fuplanner.fragments; package de.sebse.fuplanner.fragments;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.fragments.ModulesFragment.OnModulesFragmentInteractionListener; import de.sebse.fuplanner.fragments.ModulesFragment.OnModulesFragmentInteractionListener;
import de.sebse.fuplanner.services.KVV.types.Modules; import de.sebse.fuplanner.services.KVV.types.Modules;

View File

@@ -2,15 +2,15 @@ package de.sebse.fuplanner.fragments;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.KVV; import de.sebse.fuplanner.services.KVV.KVV;

View File

@@ -2,9 +2,9 @@ package de.sebse.fuplanner.fragments;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.preference.ListPreference; import androidx.preference.ListPreference;
import android.support.v7.preference.Preference; import androidx.preference.Preference;
import android.support.v7.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceFragmentCompat;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.tools.logging.Logger; import de.sebse.fuplanner.tools.logging.Logger;

View File

@@ -4,8 +4,6 @@ import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.graphics.RectF; import android.graphics.RectF;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -15,12 +13,14 @@ import java.util.Calendar;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.KVV; import de.sebse.fuplanner.services.KVV.KVV;
import de.sebse.fuplanner.services.KVV.types.Event; import de.sebse.fuplanner.services.KVV.types.Event;
import de.sebse.fuplanner.services.KVV.types.Modules; import de.sebse.fuplanner.services.KVV.types.Modules;
import de.sebse.fuplanner.tools.UtilsDate;
import de.sebse.fuplanner.tools.MainAcitivityListener; import de.sebse.fuplanner.tools.MainAcitivityListener;
import de.sebse.fuplanner.tools.UtilsDate;
import de.sebse.fuplanner.tools.logging.Logger; import de.sebse.fuplanner.tools.logging.Logger;
import de.sebse.fuplanner.tools.ui.weekview.MonthLoader; import de.sebse.fuplanner.tools.ui.weekview.MonthLoader;
import de.sebse.fuplanner.tools.ui.weekview.WeekView; import de.sebse.fuplanner.tools.ui.weekview.WeekView;

View File

@@ -1,12 +1,12 @@
package de.sebse.fuplanner.fragments; package de.sebse.fuplanner.fragments;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
/** /**

View File

@@ -1,8 +1,8 @@
package de.sebse.fuplanner.fragments.canteen; package de.sebse.fuplanner.fragments.canteen;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter; import androidx.fragment.app.FragmentStatePagerAdapter;
import de.sebse.fuplanner.services.Canteen.types.Canteen; import de.sebse.fuplanner.services.Canteen.types.Canteen;
import de.sebse.fuplanner.tools.UtilsDate; import de.sebse.fuplanner.tools.UtilsDate;

View File

@@ -2,13 +2,13 @@ package de.sebse.fuplanner.fragments.canteen;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.Canteen.CanteenBrowser; import de.sebse.fuplanner.services.Canteen.CanteenBrowser;

View File

@@ -1,9 +1,6 @@
package de.sebse.fuplanner.fragments.canteen; package de.sebse.fuplanner.fragments.canteen;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -12,6 +9,9 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.recyclerview.widget.RecyclerView;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.Canteen.types.Day; import de.sebse.fuplanner.services.Canteen.types.Day;
import de.sebse.fuplanner.services.Canteen.types.Meal; import de.sebse.fuplanner.services.Canteen.types.Meal;

View File

@@ -3,15 +3,14 @@ package de.sebse.fuplanner.fragments.canteen;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ExpandableListView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.Canteen.CanteenBrowser; import de.sebse.fuplanner.services.Canteen.CanteenBrowser;

View File

@@ -1,9 +1,9 @@
package de.sebse.fuplanner.fragments.moddetails; package de.sebse.fuplanner.fragments.moddetails;
import android.content.Context; import android.content.Context;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter; import androidx.fragment.app.FragmentStatePagerAdapter;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;

View File

@@ -2,14 +2,14 @@ package de.sebse.fuplanner.fragments.moddetails;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ExpandableListView; import android.widget.ExpandableListView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.KVV; import de.sebse.fuplanner.services.KVV.KVV;

View File

@@ -2,14 +2,14 @@ package de.sebse.fuplanner.fragments.moddetails;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ExpandableListView; import android.widget.ExpandableListView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.KVV; import de.sebse.fuplanner.services.KVV.KVV;

View File

@@ -1,7 +1,5 @@
package de.sebse.fuplanner.fragments.moddetails; package de.sebse.fuplanner.fragments.moddetails;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.util.Pair; import android.util.Pair;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@@ -9,6 +7,8 @@ import android.view.ViewGroup;
import java.util.ArrayList; import java.util.ArrayList;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.types.Event; import de.sebse.fuplanner.services.KVV.types.Event;
import de.sebse.fuplanner.services.KVV.types.Modules; import de.sebse.fuplanner.services.KVV.types.Modules;

View File

@@ -3,15 +3,15 @@ package de.sebse.fuplanner.fragments.moddetails;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.KVV; import de.sebse.fuplanner.services.KVV.KVV;

View File

@@ -2,13 +2,13 @@ package de.sebse.fuplanner.fragments.moddetails;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.types.Modules; import de.sebse.fuplanner.services.KVV.types.Modules;
import de.sebse.fuplanner.tools.MainAcitivityListener; import de.sebse.fuplanner.tools.MainAcitivityListener;

View File

@@ -1,8 +1,6 @@
package de.sebse.fuplanner.fragments.moddetails; package de.sebse.fuplanner.fragments.moddetails;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.util.Pair; import android.util.Pair;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@@ -11,10 +9,11 @@ import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.types.Gradebook; import de.sebse.fuplanner.services.KVV.types.Gradebook;
import de.sebse.fuplanner.services.KVV.types.Modules; import de.sebse.fuplanner.services.KVV.types.Modules;
import de.sebse.fuplanner.tools.ui.CustomViewHolder;
import de.sebse.fuplanner.tools.ui.StringViewHolder; import de.sebse.fuplanner.tools.ui.StringViewHolder;
class ModDetailGradebookAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { class ModDetailGradebookAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

View File

@@ -3,15 +3,15 @@ package de.sebse.fuplanner.fragments.moddetails;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.KVV; import de.sebse.fuplanner.services.KVV.KVV;

View File

@@ -1,8 +1,5 @@
package de.sebse.fuplanner.fragments.moddetails; package de.sebse.fuplanner.fragments.moddetails;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.Pair; import android.util.Pair;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@@ -12,6 +9,9 @@ import com.ms.square.android.expandabletextview.ExpandableTextView;
import java.util.ArrayList; import java.util.ArrayList;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.types.Announcement; import de.sebse.fuplanner.services.KVV.types.Announcement;
import de.sebse.fuplanner.services.KVV.types.Assignment; import de.sebse.fuplanner.services.KVV.types.Assignment;

View File

@@ -3,16 +3,16 @@ package de.sebse.fuplanner.fragments.moddetails;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.KVV; import de.sebse.fuplanner.services.KVV.KVV;

View File

@@ -8,12 +8,6 @@ import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -22,6 +16,12 @@ import android.widget.ImageView;
import java.io.File; import java.io.File;
import java.util.Arrays; import java.util.Arrays;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import de.sebse.fuplanner.MainActivity; import de.sebse.fuplanner.MainActivity;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.services.KVV.KVV; import de.sebse.fuplanner.services.KVV.KVV;

View File

@@ -1,6 +1,6 @@
package de.sebse.fuplanner.services.Canteen.types; package de.sebse.fuplanner.services.Canteen.types;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.Calendar; import java.util.Calendar;

View File

@@ -1,7 +1,7 @@
package de.sebse.fuplanner.services.Canteen.types; package de.sebse.fuplanner.services.Canteen.types;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;

View File

@@ -1,6 +1,6 @@
package de.sebse.fuplanner.services.Canteen.types; package de.sebse.fuplanner.services.Canteen.types;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.Calendar; import java.util.Calendar;

View File

@@ -2,8 +2,6 @@ package de.sebse.fuplanner.services.GoogleAuth;
import android.content.Intent; import android.content.Intent;
import android.content.IntentSender; import android.content.IntentSender;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.util.Log; import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
@@ -17,6 +15,9 @@ import com.google.android.gms.common.api.ApiException;
import com.google.android.gms.common.api.CommonStatusCodes; import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.android.gms.common.api.ResolvableApiException; import com.google.android.gms.common.api.ResolvableApiException;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
import static android.app.Activity.RESULT_OK; import static android.app.Activity.RESULT_OK;
/** /**

View File

@@ -1,13 +1,13 @@
package de.sebse.fuplanner.services.KVV; package de.sebse.fuplanner.services.KVV;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull;
import android.util.Pair; import android.util.Pair;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import androidx.annotation.NonNull;
import de.sebse.fuplanner.services.KVV.types.LoginToken; import de.sebse.fuplanner.services.KVV.types.LoginToken;
import de.sebse.fuplanner.services.KVV.types.Modules; import de.sebse.fuplanner.services.KVV.types.Modules;
import de.sebse.fuplanner.tools.MainAcitivityListener; import de.sebse.fuplanner.tools.MainAcitivityListener;

View File

@@ -1,7 +1,6 @@
package de.sebse.fuplanner.services.KVV.types; package de.sebse.fuplanner.services.KVV.types;
import android.content.Context; import android.content.Context;
import android.support.annotation.Nullable;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@@ -11,6 +10,8 @@ import java.io.ObjectOutputStream;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import androidx.annotation.Nullable;
/** /**
* Created by sebastian on 29.10.17. * Created by sebastian on 29.10.17.
*/ */

View File

@@ -1,8 +1,6 @@
package de.sebse.fuplanner.services.KVV.types; package de.sebse.fuplanner.services.KVV.types;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@@ -14,6 +12,9 @@ import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/** /**
* Created by sebastian on 29.10.17. * Created by sebastian on 29.10.17.
*/ */

View File

@@ -1,10 +1,9 @@
package de.sebse.fuplanner.services.KVV.types; package de.sebse.fuplanner.services.KVV.types;
import android.support.annotation.LayoutRes;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import androidx.annotation.LayoutRes;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.tools.ui.treeview.LayoutItemType; import de.sebse.fuplanner.tools.ui.treeview.LayoutItemType;
import de.sebse.fuplanner.tools.ui.treeview.TreeNode; import de.sebse.fuplanner.tools.ui.treeview.TreeNode;

View File

@@ -1,7 +1,7 @@
package de.sebse.fuplanner.tools; package de.sebse.fuplanner.tools;
import android.graphics.Paint; import android.graphics.Paint;
import android.support.annotation.ColorInt; import androidx.annotation.ColorInt;
public class ColorRes implements Color { public class ColorRes implements Color {
@ColorInt private final int mResId; @ColorInt private final int mResId;

View File

@@ -1,6 +1,6 @@
package de.sebse.fuplanner.tools; package de.sebse.fuplanner.tools;
import android.support.annotation.StringRes; import androidx.annotation.StringRes;
import de.sebse.fuplanner.services.Canteen.CanteenBrowser; import de.sebse.fuplanner.services.Canteen.CanteenBrowser;
import de.sebse.fuplanner.services.GoogleAuth.GoogleAuth; import de.sebse.fuplanner.services.GoogleAuth.GoogleAuth;

View File

@@ -1,8 +1,8 @@
package de.sebse.fuplanner.tools; package de.sebse.fuplanner.tools;
import android.content.Context; import android.content.Context;
import android.support.annotation.ArrayRes; import androidx.annotation.ArrayRes;
import android.support.v7.preference.PreferenceManager; import androidx.preference.PreferenceManager;
public class Preferences { public class Preferences {
public static String getString(Context context, @ArrayRes int key) { public static String getString(Context context, @ArrayRes int key) {

View File

@@ -1,7 +1,7 @@
package de.sebse.fuplanner.tools; package de.sebse.fuplanner.tools;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;

View File

@@ -4,7 +4,7 @@ import android.annotation.SuppressLint;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.os.Build; import android.os.Build;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.text.format.DateFormat; import android.text.format.DateFormat;
import com.google.android.gms.common.logging.Logger; import com.google.android.gms.common.logging.Logger;

View File

@@ -1,24 +1,18 @@
package de.sebse.fuplanner.tools.network; package de.sebse.fuplanner.tools.network;
import com.android.volley.AuthFailureError; import com.android.volley.AuthFailureError;
import com.android.volley.Header;
import com.android.volley.Request; import com.android.volley.Request;
import com.android.volley.toolbox.HttpResponse;
import com.android.volley.toolbox.HurlStack; import com.android.volley.toolbox.HurlStack;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
import org.apache.http.StatusLine;
import org.apache.http.entity.BasicHttpEntity;
import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicHttpResponse;
import org.apache.http.message.BasicStatusLine;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.FilterInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -28,12 +22,15 @@ import java.util.regex.Pattern;
import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.SSLSocketFactory;
import androidx.annotation.VisibleForTesting;
/** /**
* Created by sebastian on 29.10.17. * Created by sebastian on 29.10.17.
*/ */
public class BetterHurlStack extends HurlStack { public class BetterHurlStack extends HurlStack {
private static final String HEADER_CONTENT_TYPE = "Content-Type"; private static final String HEADER_CONTENT_TYPE = "Content-Type";
private static final int HTTP_CONTINUE = 100;
private final UrlRewriter mUrlRewriter; private final UrlRewriter mUrlRewriter;
private final SSLSocketFactory mSslSocketFactory; private final SSLSocketFactory mSslSocketFactory;
@@ -76,12 +73,12 @@ public class BetterHurlStack extends HurlStack {
} }
@Override @Override
public HttpResponse performRequest(Request<?> request, Map<String, String> additionalHeaders) public HttpResponse executeRequest(Request<?> request, Map<String, String> additionalHeaders)
throws IOException, AuthFailureError { throws IOException, AuthFailureError {
String url = request.getUrl(); String url = request.getUrl();
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.putAll(request.getHeaders());
map.putAll(additionalHeaders); map.putAll(additionalHeaders);
map.putAll(request.getHeaders());
if (mUrlRewriter != null) { if (mUrlRewriter != null) {
String rewritten = mUrlRewriter.rewriteUrl(url); String rewritten = mUrlRewriter.rewriteUrl(url);
if (rewritten == null) { if (rewritten == null) {
@@ -91,67 +88,85 @@ public class BetterHurlStack extends HurlStack {
} }
URL parsedUrl = new URL(url); URL parsedUrl = new URL(url);
HttpURLConnection connection = openConnection(parsedUrl, request); HttpURLConnection connection = openConnection(parsedUrl, request);
for (String headerName : map.keySet()) { boolean keepConnectionOpen = false;
connection.addRequestProperty(headerName, map.get(headerName)); try {
for (String headerName : map.keySet()) {
connection.setRequestProperty(headerName, map.get(headerName));
}
setConnectionParametersForRequest(connection, request);
// Initialize HttpResponse with data from the HttpURLConnection.
int responseCode = connection.getResponseCode();
if (responseCode == -1) {
// -1 is returned by getResponseCode() if the response code could not be retrieved.
// Signal to the caller that something was wrong with the connection.
throw new IOException("Could not retrieve response code from HttpUrlConnection.");
}
if (!hasResponseBody(request.getMethod(), responseCode)) {
return new HttpResponse(responseCode, convertHeaders(connection.getHeaderFields()));
}
// Need to keep the connection open until the stream is consumed by the caller. Wrap the
// stream such that close() will disconnect the connection.
keepConnectionOpen = true;
return new HttpResponse(
responseCode,
convertHeaders(connection.getHeaderFields()),
connection.getContentLength(),
new UrlConnectionInputStream(connection));
} finally {
if (!keepConnectionOpen) {
connection.disconnect();
}
} }
setConnectionParametersForRequest(connection, request); }
// Initialize HttpResponse with data from the HttpURLConnection.
ProtocolVersion protocolVersion = new ProtocolVersion("HTTP", 1, 1); @VisibleForTesting
int responseCode = connection.getResponseCode(); static List<Header> convertHeaders(Map<String, List<String>> responseHeaders) {
if (responseCode == -1) { List<Header> headerList = new ArrayList<>(responseHeaders.size());
// -1 is returned by getResponseCode() if the response code could not be retrieved. for (Map.Entry<String, List<String>> entry : responseHeaders.entrySet()) {
// Signal to the caller that something was wrong with the connection. // HttpUrlConnection includes the status line as a header with a null key; omit it here
throw new IOException("Could not retrieve response code from HttpUrlConnection."); // since it's not really a header and the rest of Volley assumes non-null keys.
} if (entry.getKey() != null) {
StatusLine responseStatus = new BasicStatusLine(protocolVersion, if (entry.getKey().equals("Set-Cookie")) {
connection.getResponseCode(), connection.getResponseMessage());
BasicHttpResponse response = new BasicHttpResponse(responseStatus);
response.setEntity(entityFromConnection(connection));
for (Map.Entry<String, List<String>> header : connection.getHeaderFields().entrySet()) {
if (header.getKey() != null) {
Header h;
if (header.getKey().equals("Set-Cookie")) {
Pattern pattern = Pattern.compile("^([^=]+=[^;]+;)"); Pattern pattern = Pattern.compile("^([^=]+=[^;]+;)");
StringBuilder cookieValue = new StringBuilder(); StringBuilder cookieValue = new StringBuilder();
for (String value: header.getValue()) { for (String value : entry.getValue()) {
Matcher matcher = pattern.matcher(value); Matcher matcher = pattern.matcher(value);
if (matcher.find()) { if (matcher.find()) {
cookieValue.append(matcher.group(1)); cookieValue.append(matcher.group(1));
} }
} }
h = new BasicHeader(header.getKey(), cookieValue.toString()); headerList.add(new Header(entry.getKey(), cookieValue.toString()));
} else { } else {
h = new BasicHeader(header.getKey(), header.getValue().get(0)); headerList.add(new Header(entry.getKey(), entry.getValue().get(0)));
} }
response.addHeader(h);
} }
} }
return response; return headerList;
} }
/** /**
* Initializes an {@link HttpEntity} from the given {@link HttpURLConnection}. * Checks if a response message contains a body.
* @param connection A http connection *
* @return an HttpEntity populated with data from <code>connection</code>. * @see <a href="https://tools.ietf.org/html/rfc7230#section-3.3">RFC 7230 section 3.3</a>
* @param requestMethod request method
* @param responseCode response status code
* @return whether the response has a body
*/ */
private static HttpEntity entityFromConnection(HttpURLConnection connection) { private static boolean hasResponseBody(int requestMethod, int responseCode) {
BasicHttpEntity entity = new BasicHttpEntity(); return requestMethod != Request.Method.HEAD
InputStream inputStream; && !(HTTP_CONTINUE <= responseCode && responseCode < HttpURLConnection.HTTP_OK)
try { && responseCode != HttpURLConnection.HTTP_NO_CONTENT
inputStream = connection.getInputStream(); && responseCode != HttpURLConnection.HTTP_NOT_MODIFIED;
} catch (IOException ioe) {
inputStream = connection.getErrorStream();
}
entity.setContent(inputStream);
entity.setContentLength(connection.getContentLength());
entity.setContentEncoding(connection.getContentEncoding());
entity.setContentType(connection.getContentType());
return entity;
} }
// NOTE: Any request headers added here (via setRequestProperty or addRequestProperty) should be
// checked against the existing properties in the connection and not overridden if already set.
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
/* package */ static void setConnectionParametersForRequest(HttpURLConnection connection, /* package */ static void setConnectionParametersForRequest(
Request<?> request) throws IOException, AuthFailureError { HttpURLConnection connection, Request<?> request) throws IOException, AuthFailureError {
switch (request.getMethod()) { switch (request.getMethod()) {
case Request.Method.DEPRECATED_GET_OR_POST: case Request.Method.DEPRECATED_GET_OR_POST:
// This is the deprecated way that needs to be handled for backwards compatibility. // This is the deprecated way that needs to be handled for backwards compatibility.
@@ -159,16 +174,8 @@ public class BetterHurlStack extends HurlStack {
// GET. Otherwise, it is assumed that the request is a POST. // GET. Otherwise, it is assumed that the request is a POST.
byte[] postBody = request.getPostBody(); byte[] postBody = request.getPostBody();
if (postBody != null) { if (postBody != null) {
// Prepare output. There is no need to set Content-Length explicitly,
// since this is handled by HttpURLConnection using the size of the prepared
// output stream.
connection.setDoOutput(true);
connection.setRequestMethod("POST"); connection.setRequestMethod("POST");
connection.addRequestProperty(HEADER_CONTENT_TYPE, addBody(connection, request, postBody);
request.getPostBodyContentType());
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
out.write(postBody);
out.close();
} }
break; break;
case Request.Method.GET: case Request.Method.GET:
@@ -209,14 +216,26 @@ public class BetterHurlStack extends HurlStack {
throws IOException, AuthFailureError { throws IOException, AuthFailureError {
byte[] body = request.getBody(); byte[] body = request.getBody();
if (body != null) { if (body != null) {
connection.setDoOutput(true); addBody(connection, request, body);
connection.addRequestProperty(HEADER_CONTENT_TYPE, request.getBodyContentType());
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
out.write(body);
out.close();
} }
} }
private static void addBody(HttpURLConnection connection, Request<?> request, byte[] body)
throws IOException {
// Prepare output. There is no need to set Content-Length explicitly,
// since this is handled by HttpURLConnection using the size of the prepared
// output stream.
connection.setDoOutput(true);
// Set the content-type unless it was already set (by Request#getHeaders).
if (!connection.getRequestProperties().containsKey(HEADER_CONTENT_TYPE)) {
connection.setRequestProperty(
HEADER_CONTENT_TYPE, request.getBodyContentType());
}
DataOutputStream out = new DataOutputStream(connection.getOutputStream());
out.write(body);
out.close();
}
private HttpURLConnection openConnection(URL url, Request<?> request) throws IOException { private HttpURLConnection openConnection(URL url, Request<?> request) throws IOException {
HttpURLConnection connection = createConnection(url); HttpURLConnection connection = createConnection(url);
int timeoutMs = request.getTimeoutMs(); int timeoutMs = request.getTimeoutMs();
@@ -230,4 +249,40 @@ public class BetterHurlStack extends HurlStack {
} }
return connection; return connection;
} }
/**
* Wrapper for a {@link HttpURLConnection}'s InputStream which disconnects the connection on
* stream close.
*/
static class UrlConnectionInputStream extends FilterInputStream {
private final HttpURLConnection mConnection;
UrlConnectionInputStream(HttpURLConnection connection) {
super(inputStreamFromConnection(connection));
mConnection = connection;
}
@Override
public void close() throws IOException {
super.close();
mConnection.disconnect();
}
}
/**
* Initializes an {@link InputStream} from the given {@link HttpURLConnection}.
*
* @param connection
* @return an HttpEntity populated with data from <code>connection</code>.
*/
private static InputStream inputStreamFromConnection(HttpURLConnection connection) {
InputStream inputStream;
try {
inputStream = connection.getInputStream();
} catch (IOException ioe) {
inputStream = connection.getErrorStream();
}
return inputStream;
}
} }

View File

@@ -1,7 +1,6 @@
package de.sebse.fuplanner.tools.network; package de.sebse.fuplanner.tools.network;
import android.content.Context; import android.content.Context;
import android.support.annotation.Nullable;
import com.android.volley.AuthFailureError; import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse; import com.android.volley.NetworkResponse;
@@ -17,6 +16,7 @@ import java.net.URLEncoder;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import androidx.annotation.Nullable;
import de.sebse.fuplanner.tools.logging.Logger; import de.sebse.fuplanner.tools.logging.Logger;
/** /**

View File

@@ -1,6 +1,6 @@
package de.sebse.fuplanner.tools.network; package de.sebse.fuplanner.tools.network;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
public interface NetworkCallback<T> { public interface NetworkCallback<T> {
void onResponse(@NonNull T success); void onResponse(@NonNull T success);

View File

@@ -1,8 +1,9 @@
package de.sebse.fuplanner.tools.ui; package de.sebse.fuplanner.tools.ui;
import android.support.v7.widget.RecyclerView;
import android.view.View; import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
public class CustomViewHolder extends RecyclerView.ViewHolder { public class CustomViewHolder extends RecyclerView.ViewHolder {
public final View mView; public final View mView;

View File

@@ -4,9 +4,6 @@ package de.sebse.fuplanner.tools.ui.cardview;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.os.Build; import android.os.Build;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.CardView;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.View; import android.view.View;
@@ -15,6 +12,9 @@ import android.view.animation.RotateAnimation;
import android.view.animation.Transformation; import android.view.animation.Transformation;
import android.widget.ImageButton; import android.widget.ImageButton;
import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.cardview.widget.CardView;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.tools.UtilsUi; import de.sebse.fuplanner.tools.UtilsUi;
import de.sebse.fuplanner.tools.logging.Logger; import de.sebse.fuplanner.tools.logging.Logger;

View File

@@ -1,6 +1,6 @@
package de.sebse.fuplanner.tools.ui.treeview; package de.sebse.fuplanner.tools.ui.treeview;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@@ -1,10 +1,6 @@
package de.sebse.fuplanner.tools.ui.treeview; package de.sebse.fuplanner.tools.ui.treeview;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.util.DiffUtil;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -13,6 +9,11 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.RecyclerView;
/** /**
* Created by tlh on 2016/10/1 :) * Created by tlh on 2016/10/1 :)
*/ */

View File

@@ -1,9 +1,10 @@
package de.sebse.fuplanner.tools.ui.treeview; package de.sebse.fuplanner.tools.ui.treeview;
import android.support.annotation.IdRes;
import android.support.v7.widget.RecyclerView;
import android.view.View; import android.view.View;
import androidx.annotation.IdRes;
import androidx.recyclerview.widget.RecyclerView;
public abstract class TreeViewBinder<VH extends RecyclerView.ViewHolder> implements LayoutItemType { public abstract class TreeViewBinder<VH extends RecyclerView.ViewHolder> implements LayoutItemType {
public abstract VH provideViewHolder(View itemView); public abstract VH provideViewHolder(View itemView);

View File

@@ -1,6 +1,6 @@
package de.sebse.fuplanner.tools.ui.weekview; package de.sebse.fuplanner.tools.ui.weekview;
import android.support.annotation.ColorInt; import androidx.annotation.ColorInt;

View File

@@ -13,11 +13,6 @@ import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.animation.FastOutLinearInInterpolator;
import android.text.Layout; import android.text.Layout;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.StaticLayout; import android.text.StaticLayout;
@@ -44,6 +39,11 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.core.view.GestureDetectorCompat;
import androidx.core.view.ViewCompat;
import androidx.interpolator.view.animation.FastOutLinearInInterpolator;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.tools.ColorRes; import de.sebse.fuplanner.tools.ColorRes;
import de.sebse.fuplanner.tools.UtilsDate; import de.sebse.fuplanner.tools.UtilsDate;

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout" android:id="@+id/drawer_layout"
@@ -13,7 +13,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<android.support.design.widget.NavigationView <com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view" android:id="@+id/nav_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
@@ -24,4 +24,4 @@
app:headerLayout="@layout/nav_header_main" app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" /> app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout> </androidx.drawerlayout.widget.DrawerLayout>

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="de.sebse.fuplanner.MainActivity"> tools:context="de.sebse.fuplanner.MainActivity">
<android.support.design.widget.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/app_bar_layout" android:id="@+id/app_bar_layout"
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
@@ -41,7 +41,7 @@
android:visibility="gone" android:visibility="gone"
android:text="@string/refresh_failed" /> android:text="@string/refresh_failed" />
</android.support.design.widget.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<FrameLayout <FrameLayout
android:id="@+id/fragcontainer" android:id="@+id/fragcontainer"
@@ -50,4 +50,4 @@
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior">
</FrameLayout> </FrameLayout>
</android.support.design.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
@@ -13,7 +13,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
tools:context=".fragments.moddetails.ModDetailAnnounceFragment" tools:context=".fragments.moddetails.ModDetailAnnounceFragment"
tools:listitem="@layout/list_all_caption" /> tools:listitem="@layout/list_all_caption" />
</android.support.v4.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@@ -21,7 +21,7 @@
android:contentDescription="@string/cd_ic_launcher"/> android:contentDescription="@string/cd_ic_launcher"/>
<!-- Email Label --> <!-- Email Label -->
<android.support.design.widget.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
@@ -31,10 +31,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textEmailAddress" android:inputType="textEmailAddress"
android:hint="@string/username" /> android:hint="@string/username" />
</android.support.design.widget.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<!-- Password Label --> <!-- Password Label -->
<android.support.design.widget.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
@@ -44,9 +44,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textPassword" android:inputType="textPassword"
android:hint="@string/password"/> android:hint="@string/password"/>
</android.support.design.widget.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<android.support.v7.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_login" android:id="@+id/btn_login"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -55,7 +55,7 @@
android:padding="12dp" android:padding="12dp"
android:text="@string/log_in"/> android:text="@string/log_in"/>
<android.support.v7.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_offline" android:id="@+id/btn_offline"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@@ -4,17 +4,17 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<android.support.v4.view.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/vpPager" android:id="@+id/vpPager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<android.support.v4.view.PagerTabStrip <androidx.viewpager.widget.PagerTabStrip
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="top" android:layout_gravity="top"
android:paddingBottom="4dp" android:paddingBottom="4dp"
android:paddingTop="4dp" /> android:paddingTop="4dp" />
</android.support.v4.view.ViewPager> </androidx.viewpager.widget.ViewPager>
</LinearLayout> </LinearLayout>

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipe_container" android:id="@+id/swipe_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/list" android:id="@+id/list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
app:layoutManager="android.support.v7.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/list_all_caption" /> tools:listitem="@layout/list_all_caption" />
</android.support.v4.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipe_container" android:id="@+id/swipe_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/list" android:id="@+id/list"
android:name=".fragments.moddetails.ModDetailOverviewFragment" android:name=".fragments.moddetails.ModDetailOverviewFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
app:layoutManager="android.support.v7.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:context=".fragments.moddetails.ModDetailOverviewFragment" tools:context=".fragments.moddetails.ModDetailOverviewFragment"
tools:listitem="@layout/list_all_caption" /> tools:listitem="@layout/list_all_caption" />
</android.support.v4.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@@ -3,9 +3,6 @@ package de.sebse.fuplanner.services.GoogleAuth;
import android.content.Intent; import android.content.Intent;
import android.content.IntentSender; import android.content.IntentSender;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.util.Log; import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
@@ -19,6 +16,10 @@ import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.ResultCallback; import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status; import com.google.android.gms.common.api.Status;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.FragmentActivity;
import static android.app.Activity.RESULT_OK; import static android.app.Activity.RESULT_OK;
/** /**

View File

@@ -9,6 +9,8 @@
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.