Changed Minimum Android API Level to 21 (Android 5) and Code clean up
This commit is contained in:
@@ -87,7 +87,7 @@
|
|||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
|
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="Gradle: __local_aars__:/media/sebastian/Daten/nextcloud/Documents/Programmierung/Java - Android Studio/fuplanner/app/libs/jericho-html-3.4.jar:unspecified@jar" level="project" />
|
<orderEntry type="library" name="Gradle: __local_aars__:/media/sebastian/Daten/nextcloud/Documents/Programmierung/Java - Android Studio/fuplanner/app/libs/jericho-html-3.4.jar:unspecified@jar" level="project" />
|
||||||
<orderEntry type="library" name="Gradle: androidx.collection:collection:1.1.0@jar" level="project" />
|
<orderEntry type="library" name="Gradle: androidx.collection:collection:1.1.0@jar" level="project" />
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 29
|
||||||
buildToolsVersion '28.0.3'
|
buildToolsVersion '28.0.3'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "de.sebse.fuplanner"
|
applicationId "de.sebse.fuplanner"
|
||||||
minSdkVersion 15
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 29
|
||||||
versionCode 39
|
versionCode 39
|
||||||
versionName "1.6"
|
versionName "1.6"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled true
|
||||||
|
shrinkResources true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,9 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".services.fulogin.FUAuthenticatorActivity"
|
android:name=".services.fulogin.FUAuthenticatorActivity"
|
||||||
android:label="@string/title_activity_fuauthenticator" />
|
android:label="@string/title_activity_fuauthenticator" />
|
||||||
<service android:name=".services.fulogin.FUAuthenticatorService">
|
<service
|
||||||
|
android:name=".services.fulogin.FUAuthenticatorService"
|
||||||
|
android:permission="de.sebse.fuplanner.Account">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.accounts.AccountAuthenticator" />
|
<action android:name="android.accounts.AccountAuthenticator" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -69,7 +68,6 @@ import de.sebse.fuplanner.tools.Preferences;
|
|||||||
import de.sebse.fuplanner.tools.Regex;
|
import de.sebse.fuplanner.tools.Regex;
|
||||||
import de.sebse.fuplanner.tools.RequestPermissionsResultListener;
|
import de.sebse.fuplanner.tools.RequestPermissionsResultListener;
|
||||||
import de.sebse.fuplanner.tools.logging.Logger;
|
import de.sebse.fuplanner.tools.logging.Logger;
|
||||||
import de.sebse.fuplanner.tools.network.NukeSSLCerts;
|
|
||||||
import de.sebse.fuplanner.tools.types.News;
|
import de.sebse.fuplanner.tools.types.News;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity
|
public class MainActivity extends AppCompatActivity
|
||||||
@@ -404,9 +402,6 @@ public class MainActivity extends AppCompatActivity
|
|||||||
case R.id.nav_rate:
|
case R.id.nav_rate:
|
||||||
Uri uri = Uri.parse("market://details?id=" + getApplicationContext().getPackageName());
|
Uri uri = Uri.parse("market://details?id=" + getApplicationContext().getPackageName());
|
||||||
Intent viewIntent = new Intent(Intent.ACTION_VIEW, uri);
|
Intent viewIntent = new Intent(Intent.ACTION_VIEW, uri);
|
||||||
if (Build.VERSION.SDK_INT <= 21)
|
|
||||||
viewIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
|
||||||
else
|
|
||||||
viewIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
viewIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||||
try {
|
try {
|
||||||
startActivity(viewIntent);
|
startActivity(viewIntent);
|
||||||
@@ -439,7 +434,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle savedInstanceState) {
|
protected void onSaveInstanceState(@NonNull Bundle savedInstanceState) {
|
||||||
if (mFragmentPage != FRAGMENT_STARTUP && mFragmentPage != FRAGMENT_NONE) {
|
if (mFragmentPage != FRAGMENT_STARTUP && mFragmentPage != FRAGMENT_NONE) {
|
||||||
Fragment fragment = mFragmentManager.findFragmentByTag(String.valueOf(mFragmentPage));
|
Fragment fragment = mFragmentManager.findFragmentByTag(String.valueOf(mFragmentPage));
|
||||||
savedInstanceState.putInt(ARG_FRAGMENT_PAGE, mFragmentPage);
|
savedInstanceState.putInt(ARG_FRAGMENT_PAGE, mFragmentPage);
|
||||||
@@ -627,7 +622,6 @@ public class MainActivity extends AppCompatActivity
|
|||||||
int size = mNavigationView.getMenu().size();
|
int size = mNavigationView.getMenu().size();
|
||||||
try {
|
try {
|
||||||
Canteen canteen = success.getCanteen(Integer.parseInt(mFragmentData));
|
Canteen canteen = success.getCanteen(Integer.parseInt(mFragmentData));
|
||||||
//noinspection ConstantConditions
|
|
||||||
String title = canteen == null ? null : canteen.getName();
|
String title = canteen == null ? null : canteen.getName();
|
||||||
for (int k = 0; k < size; k++) {
|
for (int k = 0; k < size; k++) {
|
||||||
MenuItem menuItem = mNavigationView.getMenu().getItem(k);
|
MenuItem menuItem = mNavigationView.getMenu().getItem(k);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package de.sebse.fuplanner.fragments;
|
package de.sebse.fuplanner.fragments;
|
||||||
|
|
||||||
import android.os.Build;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -24,7 +23,6 @@ import de.sebse.fuplanner.tools.ui.StringViewHolder;
|
|||||||
*/
|
*/
|
||||||
class CanteensAdapter extends RecyclerView.Adapter<CustomViewHolder> {
|
class CanteensAdapter extends RecyclerView.Adapter<CustomViewHolder> {
|
||||||
|
|
||||||
private static final int TYPE_NO_LIST_AVAILABLE = 0;
|
|
||||||
private static final int TYPE_DELETE_BUTTON = 1;
|
private static final int TYPE_DELETE_BUTTON = 1;
|
||||||
private static final int TYPE_ENTRY = 2;
|
private static final int TYPE_ENTRY = 2;
|
||||||
private Canteens mValues;
|
private Canteens mValues;
|
||||||
@@ -46,11 +44,7 @@ class CanteensAdapter extends RecyclerView.Adapter<CustomViewHolder> {
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public CustomViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public CustomViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
if (viewType == TYPE_NO_LIST_AVAILABLE) {
|
if (viewType == TYPE_DELETE_BUTTON) {
|
||||||
View view = LayoutInflater.from(parent.getContext())
|
|
||||||
.inflate(R.layout.list_all_no_items, parent, false);
|
|
||||||
return new StringViewHolder(view);
|
|
||||||
} else if (viewType == TYPE_DELETE_BUTTON) {
|
|
||||||
View view = LayoutInflater.from(parent.getContext())
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
.inflate(R.layout.list_canteens_btn_delete, parent, false);
|
.inflate(R.layout.list_canteens_btn_delete, parent, false);
|
||||||
return new StringViewHolder(view);
|
return new StringViewHolder(view);
|
||||||
@@ -63,9 +57,7 @@ class CanteensAdapter extends RecyclerView.Adapter<CustomViewHolder> {
|
|||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull CustomViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull CustomViewHolder holder, int position) {
|
||||||
int viewType = getItemViewType(position);
|
int viewType = getItemViewType(position);
|
||||||
if (viewType == TYPE_NO_LIST_AVAILABLE) {
|
if (viewType == TYPE_DELETE_BUTTON) {
|
||||||
((StringViewHolder) holder).mString.setText(R.string.canteen_not_available);
|
|
||||||
} else if (viewType == TYPE_DELETE_BUTTON) {
|
|
||||||
((StringViewHolder) holder).mString.setOnClickListener(v -> endDeletion());
|
((StringViewHolder) holder).mString.setOnClickListener(v -> endDeletion());
|
||||||
} else {
|
} else {
|
||||||
if (mIsShowDeletion) {
|
if (mIsShowDeletion) {
|
||||||
@@ -108,9 +100,6 @@ class CanteensAdapter extends RecyclerView.Adapter<CustomViewHolder> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (mValues != null) {
|
if (mValues != null) {
|
||||||
return mIsShowDeletion ? mValues.size() + 1 : mValues.size();
|
return mIsShowDeletion ? mValues.size() + 1 : mValues.size();
|
||||||
}
|
}
|
||||||
@@ -119,9 +108,6 @@ class CanteensAdapter extends RecyclerView.Adapter<CustomViewHolder> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemViewType(int position) {
|
public int getItemViewType(int position) {
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
|
|
||||||
return TYPE_NO_LIST_AVAILABLE;
|
|
||||||
}
|
|
||||||
return mIsShowDeletion && position == 0 ? TYPE_DELETE_BUTTON : TYPE_ENTRY;
|
return mIsShowDeletion && position == 0 ? TYPE_DELETE_BUTTON : TYPE_ENTRY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
import de.sebse.fuplanner.MainActivity;
|
import de.sebse.fuplanner.MainActivity;
|
||||||
import de.sebse.fuplanner.R;
|
import de.sebse.fuplanner.R;
|
||||||
@@ -88,7 +86,7 @@ public class CanteensFragment extends Fragment {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof OnCanteensFragmentInteractionListener) {
|
if (context instanceof OnCanteensFragmentInteractionListener) {
|
||||||
mListener = (OnCanteensFragmentInteractionListener) context;
|
mListener = (OnCanteensFragmentInteractionListener) context;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class ModulesFragment extends Fragment {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof OnModulesFragmentInteractionListener) {
|
if (context instanceof OnModulesFragmentInteractionListener) {
|
||||||
mListener = (OnModulesFragmentInteractionListener) context;
|
mListener = (OnModulesFragmentInteractionListener) context;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class NewsFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
mListener = (MainActivityListener) context;
|
mListener = (MainActivityListener) context;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class ScheduleFragment extends Fragment implements
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
mListener = (MainActivityListener) context;
|
mListener = (MainActivityListener) context;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package de.sebse.fuplanner.fragments.canteen;
|
package de.sebse.fuplanner.fragments.canteen;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||||
@@ -11,7 +12,7 @@ class DaySwitcherAdapter extends FragmentStatePagerAdapter {
|
|||||||
private Canteen mCanteen = null;
|
private Canteen mCanteen = null;
|
||||||
|
|
||||||
DaySwitcherAdapter(FragmentManager fm) {
|
DaySwitcherAdapter(FragmentManager fm) {
|
||||||
super(fm);
|
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModule(Canteen canteen) {
|
public void setModule(Canteen canteen) {
|
||||||
@@ -31,6 +32,7 @@ class DaySwitcherAdapter extends FragmentStatePagerAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns the fragment to display for that page
|
// Returns the fragment to display for that page
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
return MealFragment.newInstance(mCanteen.getId(), position);
|
return MealFragment.newInstance(mCanteen.getId(), position);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class DaySwitcherFragment extends Fragment implements DaySwitcherListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
mListener = (MainActivityListener) context;
|
mListener = (MainActivityListener) context;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class MealFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
Fragment parentFragment = getParentFragment();
|
Fragment parentFragment = getParentFragment();
|
||||||
if (parentFragment != null) {
|
if (parentFragment != null) {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package de.sebse.fuplanner.fragments.moddetails;
|
package de.sebse.fuplanner.fragments.moddetails;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||||
@@ -12,7 +14,7 @@ class ModDetailAdapter extends FragmentStatePagerAdapter {
|
|||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
ModDetailAdapter(FragmentManager fm, String itemPosition, Context context) {
|
ModDetailAdapter(FragmentManager fm, String itemPosition, Context context) {
|
||||||
super(fm);
|
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
this.mItemPos = itemPosition;
|
this.mItemPos = itemPosition;
|
||||||
}
|
}
|
||||||
@@ -25,6 +27,7 @@ class ModDetailAdapter extends FragmentStatePagerAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns the fragment to display for that page
|
// Returns the fragment to display for that page
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
switch (ModulePart.getPartByPage(position)) {
|
switch (ModulePart.getPartByPage(position)) {
|
||||||
|
|||||||
@@ -93,10 +93,7 @@ class ModDetailAnnounceAdapter extends RecyclerView.Adapter<CustomViewHolder> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
return URLDecoder.decode(Regex.regex("/([^/]*)$", url), "UTF-8");
|
return URLDecoder.decode(Regex.regex("/([^/]*)$", url), "UTF-8");
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException | UnsupportedEncodingException e) {
|
||||||
e.printStackTrace();
|
|
||||||
return res.getString(R.string.attachment_nr, index);
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return res.getString(R.string.attachment_nr, index);
|
return res.getString(R.string.attachment_nr, index);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class ModDetailAnnounceFragment extends Fragment implements Download.OnDo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
this.mListener = ((MainActivityListener) context);
|
this.mListener = ((MainActivityListener) context);
|
||||||
|
|||||||
@@ -93,10 +93,7 @@ class ModDetailAssignmentAdapter extends RecyclerView.Adapter<CustomViewHolder>
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
return URLDecoder.decode(Regex.regex("/([^/]*)$", url), "UTF-8");
|
return URLDecoder.decode(Regex.regex("/([^/]*)$", url), "UTF-8");
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException | UnsupportedEncodingException e) {
|
||||||
e.printStackTrace();
|
|
||||||
return res.getString(R.string.attachment_nr, index);
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return res.getString(R.string.attachment_nr, index);
|
return res.getString(R.string.attachment_nr, index);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class ModDetailAssignmentFragment extends Fragment implements Download.On
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
this.mListener = ((MainActivityListener) context);
|
this.mListener = ((MainActivityListener) context);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class ModDetailEventFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
this.mListener = ((MainActivityListener) context);
|
this.mListener = ((MainActivityListener) context);
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class ModDetailFragment extends Fragment implements ModDetailListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
mListener = (MainActivityListener) context;
|
mListener = (MainActivityListener) context;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class ModDetailGradebookFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
this.mListener = ((MainActivityListener) context);
|
this.mListener = ((MainActivityListener) context);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class ModDetailOverviewFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
this.mListener = ((MainActivityListener) context);
|
this.mListener = ((MainActivityListener) context);
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public class ModDetailResourceFragment extends Fragment implements Download.OnDo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (context instanceof MainActivityListener) {
|
if (context instanceof MainActivityListener) {
|
||||||
this.mListener = ((MainActivityListener) context);
|
this.mListener = ((MainActivityListener) context);
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package de.sebse.fuplanner.services.canteen;
|
package de.sebse.fuplanner.services.canteen;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Build;
|
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashSet;
|
|
||||||
|
|
||||||
import de.sebse.fuplanner.R;
|
import de.sebse.fuplanner.R;
|
||||||
import de.sebse.fuplanner.services.canteen.types.Canteen;
|
import de.sebse.fuplanner.services.canteen.types.Canteen;
|
||||||
@@ -37,9 +35,7 @@ public class CanteenBrowser extends HTTPService {
|
|||||||
throw new RuntimeException(context.toString() + " must implement CanteenListener");
|
throw new RuntimeException(context.toString() + " must implement CanteenListener");
|
||||||
try {
|
try {
|
||||||
this.canteens = Canteens.load(context);
|
this.canteens = Canteens.load(context);
|
||||||
} catch (IOException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,11 +64,6 @@ public class CanteenBrowser extends HTTPService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void upgradeCanteens(final NetworkCallback<Canteens> callback, final NetworkErrorCallback errorCallback) {
|
private void upgradeCanteens(final NetworkCallback<Canteens> callback, final NetworkErrorCallback errorCallback) {
|
||||||
// TSL 1.2 not supported (https://github.com/google/volley/issues/77)
|
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
|
|
||||||
callback.onResponse(new Canteens());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int[] visibleCanteens = Preferences.getArrayInt(context, R.string.pref_canteen_selection);
|
int[] visibleCanteens = Preferences.getArrayInt(context, R.string.pref_canteen_selection);
|
||||||
if (visibleCanteens == null) {
|
if (visibleCanteens == null) {
|
||||||
Preferences.setArrayInt(context, R.string.pref_canteen_selection, Canteens.availableCanteens);
|
Preferences.setArrayInt(context, R.string.pref_canteen_selection, Canteens.availableCanteens);
|
||||||
@@ -144,11 +135,6 @@ public class CanteenBrowser extends HTTPService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void upgradeCanteen(Canteen canteen, final NetworkCallback<Canteen> callback, final NetworkErrorCallback errorCallback) {
|
private void upgradeCanteen(Canteen canteen, final NetworkCallback<Canteen> callback, final NetworkErrorCallback errorCallback) {
|
||||||
// TSL 1.2 not supported (https://github.com/google/volley/issues/77)
|
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
|
|
||||||
callback.onResponse(canteen);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
get(String.format("https://openmensa.org/api/v2/canteens/%s/days", canteen.getId()), null, response -> {
|
get(String.format("https://openmensa.org/api/v2/canteens/%s/days", canteen.getId()), null, response -> {
|
||||||
String body = response.getParsed();
|
String body = response.getParsed();
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
@@ -196,11 +182,6 @@ public class CanteenBrowser extends HTTPService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void upgradeDay(Day day, final NetworkCallback<Day> callback, final NetworkErrorCallback errorCallback) {
|
private void upgradeDay(Day day, final NetworkCallback<Day> callback, final NetworkErrorCallback errorCallback) {
|
||||||
// TSL 1.2 not supported (https://github.com/google/volley/issues/77)
|
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
|
|
||||||
callback.onResponse(day);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
get(String.format("https://openmensa.org/api/v2/canteens/%s/days/%s/meals/", day.getCanteenId(), Canteen.calendarToKey(day.getCalendar())), null, response -> {
|
get(String.format("https://openmensa.org/api/v2/canteens/%s/days/%s/meals/", day.getCanteenId(), Canteen.calendarToKey(day.getCalendar())), null, response -> {
|
||||||
String body = response.getParsed();
|
String body = response.getParsed();
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
|
|||||||
@@ -73,9 +73,7 @@ public class FUAuthenticator extends AbstractAccountAuthenticator {
|
|||||||
throw new NetworkErrorException(authToken);
|
throw new NetworkErrorException(authToken);
|
||||||
else authToken = null;
|
else authToken = null;
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ExecutionException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import android.annotation.SuppressLint;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@@ -67,7 +66,7 @@ public class UserLoginTask extends AsyncTask<Void, Void, String> {
|
|||||||
AtomicReference<String> login = new AtomicReference<>();
|
AtomicReference<String> login = new AtomicReference<>();
|
||||||
NetworkErrorCallback errorFunc = error -> {
|
NetworkErrorCallback errorFunc = error -> {
|
||||||
log.e(error);
|
log.e(error);
|
||||||
login.set("Error: "+String.valueOf(error.getCode()));
|
login.set("Error: "+ error.getCode());
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
};
|
};
|
||||||
switch (mTokenType) {
|
switch (mTokenType) {
|
||||||
@@ -123,7 +122,7 @@ public class UserLoginTask extends AsyncTask<Void, Void, String> {
|
|||||||
protected void onPostExecute(final String success) {
|
protected void onPostExecute(final String success) {
|
||||||
if (mActivity == null || mActivity.isFinishing())
|
if (mActivity == null || mActivity.isFinishing())
|
||||||
return;
|
return;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && mActivity.isDestroyed())
|
if (mActivity.isDestroyed())
|
||||||
return;
|
return;
|
||||||
mActivity.mAuthTask = null;
|
mActivity.mAuthTask = null;
|
||||||
mActivity.showProgress(false);
|
mActivity.showProgress(false);
|
||||||
@@ -149,7 +148,7 @@ public class UserLoginTask extends AsyncTask<Void, Void, String> {
|
|||||||
protected void onCancelled() {
|
protected void onCancelled() {
|
||||||
if (mActivity == null || mActivity.isFinishing())
|
if (mActivity == null || mActivity.isFinishing())
|
||||||
return;
|
return;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && mActivity.isDestroyed())
|
if (mActivity.isDestroyed())
|
||||||
return;
|
return;
|
||||||
mActivity.mAuthTask = null;
|
mActivity.mAuthTask = null;
|
||||||
mActivity.showProgress(false);
|
mActivity.showProgress(false);
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import de.sebse.fuplanner.services.kvv.types.LoginTokenKVV;
|
|||||||
import de.sebse.fuplanner.tools.CustomAccountManager;
|
import de.sebse.fuplanner.tools.CustomAccountManager;
|
||||||
import de.sebse.fuplanner.tools.NetworkCallbackCollector;
|
import de.sebse.fuplanner.tools.NetworkCallbackCollector;
|
||||||
import de.sebse.fuplanner.tools.Preferences;
|
import de.sebse.fuplanner.tools.Preferences;
|
||||||
import de.sebse.fuplanner.tools.logging.Logger;
|
|
||||||
import de.sebse.fuplanner.tools.network.HTTPService;
|
import de.sebse.fuplanner.tools.network.HTTPService;
|
||||||
import de.sebse.fuplanner.tools.network.NetworkCallback;
|
import de.sebse.fuplanner.tools.network.NetworkCallback;
|
||||||
import de.sebse.fuplanner.tools.network.NetworkError;
|
import de.sebse.fuplanner.tools.network.NetworkError;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package de.sebse.fuplanner.services.kvv;
|
package de.sebse.fuplanner.services.kvv;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Build;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
@@ -89,11 +88,6 @@ public class ModulesEvents extends PartModules<EventList> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void upgradeBB(String ID, NetworkCallback<EventList> callback, NetworkErrorCallback errorCallback) {
|
protected void upgradeBB(String ID, NetworkCallback<EventList> callback, NetworkErrorCallback errorCallback) {
|
||||||
// TSL 1.2 not supported (https://github.com/google/volley/issues/77)
|
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
|
|
||||||
callback.onResponse(new EventList());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!mLogin.isInOnlineMode() || mLogin.getLoginTokenBB() == null || !mLogin.getLoginTokenBB().isAvailable()) {
|
if (!mLogin.isInOnlineMode() || mLogin.getLoginTokenBB() == null || !mLogin.getLoginTokenBB().isAvailable()) {
|
||||||
errorCallback.onError(new NetworkError(101414, 500, "Currently running in offline mode!"));
|
errorCallback.onError(new NetworkError(101414, 500, "Currently running in offline mode!"));
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2,17 +2,9 @@ package de.sebse.fuplanner.services.kvv;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
|
|
||||||
import de.sebse.fuplanner.services.kvv.types.CacheBBEventNumber;
|
import de.sebse.fuplanner.services.kvv.types.CacheBBEventNumber;
|
||||||
import de.sebse.fuplanner.services.kvv.types.CacheLecturer;
|
|
||||||
import de.sebse.fuplanner.services.kvv.types.Lecturer;
|
|
||||||
import de.sebse.fuplanner.tools.Regex;
|
import de.sebse.fuplanner.tools.Regex;
|
||||||
import de.sebse.fuplanner.tools.network.HTTPService;
|
import de.sebse.fuplanner.tools.network.HTTPService;
|
||||||
import de.sebse.fuplanner.tools.network.NetworkCallback;
|
import de.sebse.fuplanner.tools.network.NetworkCallback;
|
||||||
@@ -27,9 +19,7 @@ class ModulesEventsNumber extends HTTPService {
|
|||||||
CacheBBEventNumber storage = null;
|
CacheBBEventNumber storage = null;
|
||||||
try {
|
try {
|
||||||
storage = CacheBBEventNumber.load(context);
|
storage = CacheBBEventNumber.load(context);
|
||||||
} catch (IOException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (storage == null) {
|
if (storage == null) {
|
||||||
|
|||||||
@@ -102,9 +102,7 @@ public class ModulesList extends HTTPService {
|
|||||||
try {
|
try {
|
||||||
this.mModules = Modules.load(getContext());
|
this.mModules = Modules.load(getContext());
|
||||||
} catch (FileNotFoundException ignored) {
|
} catch (FileNotFoundException ignored) {
|
||||||
} catch (IOException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (this.mModules == null) {
|
if (this.mModules == null) {
|
||||||
@@ -429,9 +427,7 @@ public class ModulesList extends HTTPService {
|
|||||||
if (mBBCache == null) {
|
if (mBBCache == null) {
|
||||||
try {
|
try {
|
||||||
mBBCache = CacheBBCourse.load(getContext());
|
mBBCache = CacheBBCourse.load(getContext());
|
||||||
} catch (IOException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -444,9 +440,7 @@ public class ModulesList extends HTTPService {
|
|||||||
if (mKVVCache == null) {
|
if (mKVVCache == null) {
|
||||||
try {
|
try {
|
||||||
mKVVCache = CacheKVVCourse.load(getContext());
|
mKVVCache = CacheKVVCourse.load(getContext());
|
||||||
} catch (IOException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ class ModulesListLecturer extends HTTPService {
|
|||||||
CacheLecturer storage = null;
|
CacheLecturer storage = null;
|
||||||
try {
|
try {
|
||||||
storage = CacheLecturer.load(context);
|
storage = CacheLecturer.load(context);
|
||||||
} catch (IOException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (storage == null) {
|
if (storage == null) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package de.sebse.fuplanner.services.kvv;
|
package de.sebse.fuplanner.services.kvv;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
@@ -101,9 +100,7 @@ public class ModulesResources extends PartModules<ArrayList<Resource>> {
|
|||||||
for (Resource res2: resources) {
|
for (Resource res2: resources) {
|
||||||
try {
|
try {
|
||||||
String utf8Name;
|
String utf8Name;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
|
|
||||||
utf8Name = StandardCharsets.UTF_8.name();
|
utf8Name = StandardCharsets.UTF_8.name();
|
||||||
else utf8Name = "UTF-8";
|
|
||||||
if (URLDecoder.decode(res2.getUrl(), utf8Name).endsWith(res.getContainer()) && res2 instanceof Resource.Folder) {
|
if (URLDecoder.decode(res2.getUrl(), utf8Name).endsWith(res.getContainer()) && res2 instanceof Resource.Folder) {
|
||||||
// Append File/Folder to list
|
// Append File/Folder to list
|
||||||
((Resource.Folder) res2).add(res);
|
((Resource.Folder) res2).add(res);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package de.sebse.fuplanner.services.kvv.sync;
|
package de.sebse.fuplanner.services.kvv.sync;
|
||||||
|
|
||||||
import android.accounts.Account;
|
import android.accounts.Account;
|
||||||
import android.accounts.AccountManager;
|
|
||||||
import android.content.AbstractThreadedSyncAdapter;
|
import android.content.AbstractThreadedSyncAdapter;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.ContentProviderClient;
|
import android.content.ContentProviderClient;
|
||||||
@@ -19,7 +18,6 @@ import androidx.annotation.StringRes;
|
|||||||
import de.sebse.fuplanner.R;
|
import de.sebse.fuplanner.R;
|
||||||
import de.sebse.fuplanner.fragments.moddetails.ModulePart;
|
import de.sebse.fuplanner.fragments.moddetails.ModulePart;
|
||||||
import de.sebse.fuplanner.services.kvv.KVV;
|
import de.sebse.fuplanner.services.kvv.KVV;
|
||||||
import de.sebse.fuplanner.services.kvv.KVVListener;
|
|
||||||
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;
|
||||||
import de.sebse.fuplanner.services.kvv.types.AssignmentList;
|
import de.sebse.fuplanner.services.kvv.types.AssignmentList;
|
||||||
@@ -27,7 +25,6 @@ import de.sebse.fuplanner.services.kvv.types.EventList;
|
|||||||
import de.sebse.fuplanner.services.kvv.types.Grade;
|
import de.sebse.fuplanner.services.kvv.types.Grade;
|
||||||
import de.sebse.fuplanner.services.kvv.types.Modules;
|
import de.sebse.fuplanner.services.kvv.types.Modules;
|
||||||
import de.sebse.fuplanner.services.kvv.types.Resource;
|
import de.sebse.fuplanner.services.kvv.types.Resource;
|
||||||
import de.sebse.fuplanner.tools.CustomAccountManager;
|
|
||||||
import de.sebse.fuplanner.tools.CustomNotificationManager;
|
import de.sebse.fuplanner.tools.CustomNotificationManager;
|
||||||
import de.sebse.fuplanner.tools.NewAsyncQueue;
|
import de.sebse.fuplanner.tools.NewAsyncQueue;
|
||||||
import de.sebse.fuplanner.tools.UtilsDate;
|
import de.sebse.fuplanner.tools.UtilsDate;
|
||||||
@@ -139,7 +136,7 @@ public class KVVSyncAdapter extends AbstractThreadedSyncAdapter {
|
|||||||
sendNotifications(assignments, module.assignments, module.title, Assignment::getTitle, Assignment::getId,
|
sendNotifications(assignments, module.assignments, module.title, Assignment::getTitle, Assignment::getId,
|
||||||
module.getID(), ModulePart.ASSIGNMENT,
|
module.getID(), ModulePart.ASSIGNMENT,
|
||||||
R.string.assignment_updated, R.string.assignment_added, R.string.assignment_removed);
|
R.string.assignment_updated, R.string.assignment_added, R.string.assignment_removed);
|
||||||
sendNotifications(events, module.events, module.title, evt -> evt.getTitle()+" - "+UtilsDate.getModifiedDate(evt.getStartDate()), event -> String.valueOf(event.getStartDate())+event.getType()+event.getTitle(),
|
sendNotifications(events, module.events, module.title, evt -> evt.getTitle()+" - "+UtilsDate.getModifiedDate(evt.getStartDate()), event -> event.getStartDate() +event.getType()+event.getTitle(),
|
||||||
module.getID(), ModulePart.EVENT,
|
module.getID(), ModulePart.EVENT,
|
||||||
R.string.event_updated, R.string.event_added, R.string.event_removed);
|
R.string.event_updated, R.string.event_added, R.string.event_removed);
|
||||||
sendNotifications(gradebook, module.gradebook, module.title, Grade::getItemName, Grade::getItemName,
|
sendNotifications(gradebook, module.gradebook, module.title, Grade::getItemName, Grade::getItemName,
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import java.io.ObjectInputStream;
|
|||||||
import java.io.ObjectOutputStream;
|
import java.io.ObjectOutputStream;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
|
|
||||||
public class CacheKVVCourse implements Serializable {
|
public class CacheKVVCourse implements Serializable {
|
||||||
private transient static final long RESAVE_TIMER = 1000L * 60 * 60 * 24 * 30;
|
private transient static final long RESAVE_TIMER = 1000L * 60 * 60 * 24 * 30;
|
||||||
|
|||||||
@@ -69,11 +69,7 @@ public class Event implements Serializable {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
byte[] encodedHash;
|
byte[] encodedHash;
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
|
|
||||||
encodedHash = digest.digest(siteId.getBytes(StandardCharsets.UTF_8));
|
encodedHash = digest.digest(siteId.getBytes(StandardCharsets.UTF_8));
|
||||||
} else {
|
|
||||||
encodedHash = digest.digest(siteId.getBytes());
|
|
||||||
}
|
|
||||||
int h = (0xff & encodedHash[0]) + (0xff & encodedHash[1]) * 255;
|
int h = (0xff & encodedHash[0]) + (0xff & encodedHash[1]) * 255;
|
||||||
h = h * 360 / 0xffff;
|
h = h * 360 / 0xffff;
|
||||||
//int s = 0xff & encodedHash[2];
|
//int s = 0xff & encodedHash[2];
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ public class Modules implements Iterable<Modules.Module>, Serializable {
|
|||||||
@Nullable public final String type;
|
@Nullable public final String type;
|
||||||
@Nullable public final String description;
|
@Nullable public final String description;
|
||||||
@NotNull private final String ID;
|
@NotNull private final String ID;
|
||||||
@NotNull private final int moduleType;
|
private final int moduleType;
|
||||||
@Nullable public ArrayList<Announcement> announcements;
|
@Nullable public ArrayList<Announcement> announcements;
|
||||||
@Nullable public AssignmentList assignments;
|
@Nullable public AssignmentList assignments;
|
||||||
@Nullable public EventList events;
|
@Nullable public EventList events;
|
||||||
@@ -195,7 +195,7 @@ public class Modules implements Iterable<Modules.Module>, Serializable {
|
|||||||
return userPoint/maxPoint;
|
return userPoint/maxPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Module(@Nullable Semester semester, @NotNull HashSet<String> lvNumber, @NotNull String title, @NotNull LinkedHashSet<Lecturer> lecturer, @Nullable String type, @Nullable String description, @NotNull String ID, @NotNull int moduleType) {
|
private Module(@Nullable Semester semester, @NotNull HashSet<String> lvNumber, @NotNull String title, @NotNull LinkedHashSet<Lecturer> lecturer, @Nullable String type, @Nullable String description, @NotNull String ID, int moduleType) {
|
||||||
|
|
||||||
title = title.replaceAll("(.*?) (S[0-9]{2}|W[0-9/]{5})", "$1");
|
title = title.replaceAll("(.*?) (S[0-9]{2}|W[0-9/]{5})", "$1");
|
||||||
|
|
||||||
@@ -238,6 +238,7 @@ public class Modules implements Iterable<Modules.Module>, Serializable {
|
|||||||
return moduleType;
|
return moduleType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public Module clone() {
|
public Module clone() {
|
||||||
return new Module(semester, lvNumber, title, new LinkedHashSet<>(lecturer), type, description, ID, moduleType);
|
return new Module(semester, lvNumber, title, new LinkedHashSet<>(lecturer), type, description, ID, moduleType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import android.net.Uri;
|
|||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -148,11 +147,6 @@ public class Download {
|
|||||||
showDownloadError();
|
showDownloadError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ArrayList<Integer> intList = new ArrayList<>();
|
|
||||||
for (int i : grantResults)
|
|
||||||
{
|
|
||||||
intList.add(i);
|
|
||||||
}
|
|
||||||
int pos = Arrays.asList(permissions).indexOf("android.permission.WRITE_EXTERNAL_STORAGE");
|
int pos = Arrays.asList(permissions).indexOf("android.permission.WRITE_EXTERNAL_STORAGE");
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
if (grantResults[pos] != -1) {
|
if (grantResults[pos] != -1) {
|
||||||
@@ -194,11 +188,7 @@ public class Download {
|
|||||||
Uri uri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".my.provider", url);
|
Uri uri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".my.provider", url);
|
||||||
|
|
||||||
Intent intent;
|
Intent intent;
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
|
|
||||||
intent = new Intent(Intent.ACTION_VIEW);
|
intent = new Intent(Intent.ACTION_VIEW);
|
||||||
} else {
|
|
||||||
intent = new Intent();
|
|
||||||
}
|
|
||||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||||
// Check what kind of file you are trying to open, by comparing the url with extensions.
|
// Check what kind of file you are trying to open, by comparing the url with extensions.
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.json.JSONObject;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import de.sebse.fuplanner.R;
|
import de.sebse.fuplanner.R;
|
||||||
@@ -82,7 +83,7 @@ public class NewsManager {
|
|||||||
byte[] buffer = new byte[size];
|
byte[] buffer = new byte[size];
|
||||||
is.read(buffer);
|
is.read(buffer);
|
||||||
is.close();
|
is.close();
|
||||||
return new String(buffer, "UTF-8");
|
return new String(buffer, StandardCharsets.UTF_8);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -34,11 +34,7 @@ public class CustomAccountManager {
|
|||||||
try {
|
try {
|
||||||
String token = mAccountManager.blockingGetAuthToken(account, authTokenType, true);
|
String token = mAccountManager.blockingGetAuthToken(account, authTokenType, true);
|
||||||
mAccountManager.invalidateAuthToken(accountType, token);
|
mAccountManager.invalidateAuthToken(accountType, token);
|
||||||
} catch (AuthenticatorException e) {
|
} catch (AuthenticatorException | OperationCanceledException | IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (OperationCanceledException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,11 +49,7 @@ public class CustomAccountManager {
|
|||||||
if (callback != null)
|
if (callback != null)
|
||||||
callback.run(true);
|
callback.run(true);
|
||||||
return;
|
return;
|
||||||
} catch (AuthenticatorException e) {
|
} catch (AuthenticatorException | OperationCanceledException | IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (OperationCanceledException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (callback != null)
|
if (callback != null)
|
||||||
@@ -102,11 +94,7 @@ public class CustomAccountManager {
|
|||||||
Account account = mAccountManager.getAccountsByType(accountType)[0];
|
Account account = mAccountManager.getAccountsByType(accountType)[0];
|
||||||
try {
|
try {
|
||||||
return mAccountManager.blockingGetAuthToken(account, authTokenType, true);
|
return mAccountManager.blockingGetAuthToken(account, authTokenType, true);
|
||||||
} catch (AuthenticatorException e) {
|
} catch (AuthenticatorException | OperationCanceledException | IOException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (OperationCanceledException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import androidx.annotation.StringRes;
|
|||||||
|
|
||||||
import de.sebse.fuplanner.MainActivity;
|
import de.sebse.fuplanner.MainActivity;
|
||||||
import de.sebse.fuplanner.services.canteen.CanteenBrowser;
|
import de.sebse.fuplanner.services.canteen.CanteenBrowser;
|
||||||
import de.sebse.fuplanner.services.kvv.KVV;
|
|
||||||
import de.sebse.fuplanner.services.kvv.KVVListener;
|
|
||||||
import de.sebse.fuplanner.services.news.NewsManager;
|
import de.sebse.fuplanner.services.news.NewsManager;
|
||||||
|
|
||||||
public interface MainActivityListener {
|
public interface MainActivityListener {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package de.sebse.fuplanner.tools;
|
|||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
import de.sebse.fuplanner.tools.logging.Logger;
|
|
||||||
import de.sebse.fuplanner.tools.network.NetworkCallback;
|
import de.sebse.fuplanner.tools.network.NetworkCallback;
|
||||||
import de.sebse.fuplanner.tools.network.NetworkErrorCallback;
|
import de.sebse.fuplanner.tools.network.NetworkErrorCallback;
|
||||||
|
|
||||||
|
|||||||
@@ -49,11 +49,7 @@ public class UtilsDate {
|
|||||||
skeleton = skeleton.replaceAll("h", "H");
|
skeleton = skeleton.replaceAll("h", "H");
|
||||||
if (context != null && !DateFormat.is24HourFormat(context))
|
if (context != null && !DateFormat.is24HourFormat(context))
|
||||||
skeleton = skeleton.replaceAll("H", "h");
|
skeleton = skeleton.replaceAll("H", "h");
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
|
||||||
dateFormat = new SimpleDateFormat(getDateFormat(locale, skeleton));
|
dateFormat = new SimpleDateFormat(getDateFormat(locale, skeleton));
|
||||||
} else {
|
|
||||||
dateFormat = new SimpleDateFormat(skeleton, locale);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dateFormat.format(new Date(modified));
|
return dateFormat.format(new Date(modified));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.android.volley.toolbox.Volley;
|
|||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -144,11 +145,7 @@ public class HTTPNetwork extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
String requestBody = sb.toString();
|
String requestBody = sb.toString();
|
||||||
try {
|
return requestBody.getBytes(StandardCharsets.UTF_8);
|
||||||
return requestBody.getBytes("utf-8");
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -31,6 +31,6 @@ public class NetworkError {
|
|||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.valueOf(getCode()) + " - " + getHttpStatus() + " - " + getMessage();
|
return getCode() + " - " + getHttpStatus() + " - " + getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
package de.sebse.fuplanner.tools.network;
|
|
||||||
|
|
||||||
import java.security.SecureRandom;
|
|
||||||
import java.security.cert.X509Certificate;
|
|
||||||
|
|
||||||
import javax.net.ssl.HostnameVerifier;
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
|
||||||
import javax.net.ssl.SSLContext;
|
|
||||||
import javax.net.ssl.SSLSession;
|
|
||||||
import javax.net.ssl.TrustManager;
|
|
||||||
import javax.net.ssl.X509TrustManager;
|
|
||||||
|
|
||||||
public class NukeSSLCerts {
|
|
||||||
protected static final String TAG = "NukeSSLCerts";
|
|
||||||
|
|
||||||
public static void nuke() {
|
|
||||||
try {
|
|
||||||
TrustManager[] trustAllCerts = new TrustManager[] {
|
|
||||||
new X509TrustManager() {
|
|
||||||
public X509Certificate[] getAcceptedIssuers() {
|
|
||||||
X509Certificate[] myTrustedAnchors = new X509Certificate[0];
|
|
||||||
return myTrustedAnchors;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void checkClientTrusted(X509Certificate[] certs, String authType) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void checkServerTrusted(X509Certificate[] certs, String authType) {}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SSLContext sc = SSLContext.getInstance("SSL");
|
|
||||||
sc.init(null, trustAllCerts, new SecureRandom());
|
|
||||||
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
|
||||||
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
|
|
||||||
@Override
|
|
||||||
public boolean verify(String arg0, SSLSession arg1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package de.sebse.fuplanner.tools.types;
|
package de.sebse.fuplanner.tools.types;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
public class News {
|
public class News {
|
||||||
public static final int CATEGORY_TRICKS = 0;
|
public static final int CATEGORY_TRICKS = 0;
|
||||||
public static final int CATEGORY_UPDATE = 1;
|
public static final int CATEGORY_UPDATE = 1;
|
||||||
@@ -32,6 +34,7 @@ public class News {
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "News{" +
|
return "News{" +
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ package de.sebse.fuplanner.tools.ui;
|
|||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
|
|
||||||
import de.sebse.fuplanner.R;
|
import de.sebse.fuplanner.R;
|
||||||
|
|
||||||
|
|||||||
@@ -103,11 +103,9 @@ public class ExpandableCardView extends CardView {
|
|||||||
(int) UtilsUi.convertDpToPixels(getContext(), 10),
|
(int) UtilsUi.convertDpToPixels(getContext(), 10),
|
||||||
(int) UtilsUi.convertDpToPixels(getContext(), 10)
|
(int) UtilsUi.convertDpToPixels(getContext(), 10)
|
||||||
);
|
);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
|
||||||
TypedValue outValue = new TypedValue();
|
TypedValue outValue = new TypedValue();
|
||||||
context.getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
|
context.getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
|
||||||
imageButton.setBackgroundResource(outValue.resourceId);
|
imageButton.setBackgroundResource(outValue.resourceId);
|
||||||
}
|
|
||||||
isExpanded = startExpanded;
|
isExpanded = startExpanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,8 @@ public class TreeNode<T extends LayoutItemType> implements Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings({"CloneDoesntDeclareCloneNotSupportedException", "MethodDoesntCallSuperMethod"})
|
@NonNull
|
||||||
|
@SuppressWarnings({"CloneDoesntDeclareCloneNotSupportedException"})
|
||||||
@Override
|
@Override
|
||||||
protected TreeNode<T> clone() {
|
protected TreeNode<T> clone() {
|
||||||
TreeNode<T> clone = new TreeNode<>(this.content);
|
TreeNode<T> clone = new TreeNode<>(this.content);
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ public class WeekView extends View {
|
|||||||
mDoubleTapListener.onDoubleTapListener((Calendar) selectedTime.clone());
|
mDoubleTapListener.onDoubleTapListener((Calendar) selectedTime.clone());
|
||||||
}
|
}
|
||||||
if (mDoubleTapLeftRightListener != null)
|
if (mDoubleTapLeftRightListener != null)
|
||||||
mDoubleTapLeftRightListener.onDoubleTapLeftRightListener(getWidth()/2 < e.getX());
|
mDoubleTapLeftRightListener.onDoubleTapLeftRightListener(getWidth() / 2.0 < e.getX());
|
||||||
return super.onDoubleTap(e);
|
return super.onDoubleTap(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:drawableLeft="@drawable/ic_folder"
|
|
||||||
android:drawablePadding="10sp"
|
android:drawablePadding="10sp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
tools:text="@string/app_name"
|
tools:text="@string/app_name"
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
android:drawableLeft="@drawable/ic_insert_drive_file"
|
|
||||||
android:drawablePadding="10sp"
|
android:drawablePadding="10sp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
tools:text="@string/app_name"
|
tools:text="@string/app_name"
|
||||||
@@ -14,6 +13,5 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:drawableStart="@drawable/ic_insert_drive_file"
|
android:drawableStart="@drawable/ic_insert_drive_file"
|
||||||
android:layout_marginStart="18dp"
|
android:layout_marginStart="18dp" />
|
||||||
android:layout_marginLeft="18dp" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -39,7 +39,6 @@
|
|||||||
android:textColor="#343434"
|
android:textColor="#343434"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
tools:text="20.03.18 18:42 Uhr" />
|
tools:text="20.03.18 18:42 Uhr" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -51,7 +50,6 @@
|
|||||||
android:textColor="#343434"
|
android:textColor="#343434"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
tools:text="Room 105"
|
tools:text="Room 105"
|
||||||
tools:ignore="RelativeOverlap" />
|
tools:ignore="RelativeOverlap" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
@@ -35,8 +35,6 @@
|
|||||||
android:layout_alignTop="@id/title"
|
android:layout_alignTop="@id/title"
|
||||||
android:layout_alignBottom="@id/sub_left"
|
android:layout_alignBottom="@id/sub_left"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:contentDescription="@string/mail_icon"
|
android:contentDescription="@string/mail_icon"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/ic_mail"
|
android:src="@drawable/ic_mail"
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/vegetarian"
|
android:text="@string/vegetarian"
|
||||||
android:drawableStart="@mipmap/ic_vegetarian"
|
android:drawableStart="@mipmap/ic_vegetarian"
|
||||||
android:drawableLeft="@mipmap/ic_vegetarian"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
app:compoundDrawableHeight="16dp"
|
app:compoundDrawableHeight="16dp"
|
||||||
app:compoundDrawableWidth="16dp" />
|
app:compoundDrawableWidth="16dp" />
|
||||||
@@ -20,7 +19,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/vegan"
|
android:text="@string/vegan"
|
||||||
android:drawableStart="@mipmap/ic_vegan"
|
android:drawableStart="@mipmap/ic_vegan"
|
||||||
android:drawableLeft="@mipmap/ic_vegan"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
app:compoundDrawableHeight="16dp"
|
app:compoundDrawableHeight="16dp"
|
||||||
app:compoundDrawableWidth="16dp" />
|
app:compoundDrawableWidth="16dp" />
|
||||||
@@ -30,7 +28,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/msc"
|
android:text="@string/msc"
|
||||||
android:drawableStart="@mipmap/ic_msc"
|
android:drawableStart="@mipmap/ic_msc"
|
||||||
android:drawableLeft="@mipmap/ic_msc"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
app:compoundDrawableHeight="16dp"
|
app:compoundDrawableHeight="16dp"
|
||||||
app:compoundDrawableWidth="16dp" />
|
app:compoundDrawableWidth="16dp" />
|
||||||
@@ -40,7 +37,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/bio"
|
android:text="@string/bio"
|
||||||
android:drawableStart="@mipmap/ic_organic"
|
android:drawableStart="@mipmap/ic_organic"
|
||||||
android:drawableLeft="@mipmap/ic_organic"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
app:compoundDrawableHeight="16dp"
|
app:compoundDrawableHeight="16dp"
|
||||||
app:compoundDrawableWidth="16dp" />
|
app:compoundDrawableWidth="16dp" />
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_remove_circle_outline"
|
android:src="@drawable/ic_remove_circle_outline"
|
||||||
android:contentDescription="TODO"
|
android:contentDescription="@string/remove_entry"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:padding="8dp"/>
|
android:padding="8dp"/>
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
@@ -50,7 +50,6 @@
|
|||||||
android:textColor="#343434"
|
android:textColor="#343434"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
tools:text="20.03.18 18:42 Uhr" />
|
tools:text="20.03.18 18:42 Uhr" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -62,7 +61,6 @@
|
|||||||
android:textColor="#343434"
|
android:textColor="#343434"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
tools:text="Room 105"
|
tools:text="Room 105"
|
||||||
tools:ignore="RelativeOverlap" />
|
tools:ignore="RelativeOverlap" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:expandableTextView="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<!-- sample xml -->
|
<!-- sample xml -->
|
||||||
<com.ms.square.android.expandabletextview.ExpandableTextView
|
<com.ms.square.android.expandabletextview.ExpandableTextView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:expandableTextView="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/expand_text_view"
|
android:id="@+id/expand_text_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -12,9 +12,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:typeface="sans"
|
android:typeface="sans"
|
||||||
android:layout_toLeftOf="@+id/grade"
|
|
||||||
android:layout_toStartOf="@+id/grade"
|
android:layout_toStartOf="@+id/grade"
|
||||||
android:layout_marginRight="10dip"
|
|
||||||
android:layout_marginEnd="10dip"
|
android:layout_marginEnd="10dip"
|
||||||
tools:text="Test this new stuff!" />
|
tools:text="Test this new stuff!" />
|
||||||
|
|
||||||
@@ -27,7 +25,6 @@
|
|||||||
android:textColor="#343434"
|
android:textColor="#343434"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
tools:text="8"
|
tools:text="8"
|
||||||
android:layout_toLeftOf="@id/slash"
|
|
||||||
android:layout_toStartOf="@id/slash"
|
android:layout_toStartOf="@id/slash"
|
||||||
android:layout_alignTop="@id/title" />
|
android:layout_alignTop="@id/title" />
|
||||||
|
|
||||||
@@ -39,7 +36,6 @@
|
|||||||
android:textColor="#343434"
|
android:textColor="#343434"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
android:text="@string/grade_separator"
|
android:text="@string/grade_separator"
|
||||||
android:layout_toLeftOf="@id/grade_max"
|
|
||||||
android:layout_toStartOf="@id/grade_max"
|
android:layout_toStartOf="@id/grade_max"
|
||||||
android:layout_alignTop="@id/title" />
|
android:layout_alignTop="@id/title" />
|
||||||
|
|
||||||
@@ -52,6 +48,5 @@
|
|||||||
android:textColor="#343434"
|
android:textColor="#343434"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
tools:text="10" />
|
tools:text="10" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -45,7 +45,6 @@
|
|||||||
tools:text="20.09.2018"
|
tools:text="20.09.2018"
|
||||||
android:textColor="@color/colorFUOrange"
|
android:textColor="@color/colorFUOrange"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_below="@id/header" />
|
android:layout_below="@id/header" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -86,10 +86,6 @@
|
|||||||
<string name="tricks">Tipps/Tricks</string>
|
<string name="tricks">Tipps/Tricks</string>
|
||||||
<string name="back_to_exit">Klicke ZURÜCK erneut zum Beenden!</string>
|
<string name="back_to_exit">Klicke ZURÜCK erneut zum Beenden!</string>
|
||||||
<string name="title_activity_fuauthenticator">Sign in</string>
|
<string name="title_activity_fuauthenticator">Sign in</string>
|
||||||
<string name="prompt_email">Benutzername</string>
|
|
||||||
<string name="prompt_password">Passwort (optional)</string>
|
|
||||||
<string name="action_sign_in">Log in</string>
|
|
||||||
<string name="action_sign_in_short">Log in</string>
|
|
||||||
<string name="error_invalid_password">Das Passwort ist zu kurz.</string>
|
<string name="error_invalid_password">Das Passwort ist zu kurz.</string>
|
||||||
<string name="error_incorrect_password">Das Passwort ist nicht korrekt.</string>
|
<string name="error_incorrect_password">Das Passwort ist nicht korrekt.</string>
|
||||||
<string name="error_field_required">Pflichtfeld</string>
|
<string name="error_field_required">Pflichtfeld</string>
|
||||||
@@ -117,4 +113,5 @@
|
|||||||
<string name="canteen_not_available">Die Kantinenliste ist für Android 4 und darunter nicht verfügbar!</string>
|
<string name="canteen_not_available">Die Kantinenliste ist für Android 4 und darunter nicht verfügbar!</string>
|
||||||
<string name="restore">Einträge zurücksetzen</string>
|
<string name="restore">Einträge zurücksetzen</string>
|
||||||
<string name="delete_items">Einträge löschen</string>
|
<string name="delete_items">Einträge löschen</string>
|
||||||
|
<string name="remove_entry">Entrag entfernen</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
|
|
||||||
<style name="FUTheme" parent="Theme.AppCompat.Light.NoActionBar" >
|
|
||||||
<item name="android:colorPrimary">@color/colorFUGreen</item>
|
|
||||||
<item name="android:colorAccent">@color/colorFUBlue</item>
|
|
||||||
<item name="android:colorPrimaryDark">@color/colorFUGreenDark</item>
|
|
||||||
<item name="android:colorBackground">@color/colorFUGray</item>
|
|
||||||
<item name="android:statusBarColor">?android:attr/colorPrimaryDark</item>
|
|
||||||
<item name="colorPrimary">@color/colorFUGreen</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorFUGreenDark</item>
|
|
||||||
<item name="colorAccent">@color/colorFUBlue</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="FUTheme_Dialog" parent="android:Theme.Material.Light.Dialog.NoActionBar" >
|
|
||||||
<item name="android:colorPrimary">@color/colorFUGreen</item>
|
|
||||||
<item name="android:colorPrimaryDark">@color/colorFUGreenDark</item>
|
|
||||||
<item name="android:colorAccent">@color/colorFUBlue</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
||||||
@@ -94,10 +94,6 @@
|
|||||||
<string name="tricks">Tips/Tricks</string>
|
<string name="tricks">Tips/Tricks</string>
|
||||||
<string name="back_to_exit">Please click BACK again to exit!</string>
|
<string name="back_to_exit">Please click BACK again to exit!</string>
|
||||||
<string name="title_activity_fuauthenticator">Sign in</string>
|
<string name="title_activity_fuauthenticator">Sign in</string>
|
||||||
<string name="prompt_email">Username</string>
|
|
||||||
<string name="prompt_password">Password (optional)</string>
|
|
||||||
<string name="action_sign_in">Sign in or register</string>
|
|
||||||
<string name="action_sign_in_short">Sign in</string>
|
|
||||||
<string name="error_invalid_password">This password is too short</string>
|
<string name="error_invalid_password">This password is too short</string>
|
||||||
<string name="error_incorrect_password">This password is incorrect</string>
|
<string name="error_incorrect_password">This password is incorrect</string>
|
||||||
<string name="error_field_required">This field is required</string>
|
<string name="error_field_required">This field is required</string>
|
||||||
@@ -125,4 +121,5 @@
|
|||||||
<string name="canteen_not_available">The canteen list is not available for Android 4 and below!</string>
|
<string name="canteen_not_available">The canteen list is not available for Android 4 and below!</string>
|
||||||
<string name="restore">Restore Defaults</string>
|
<string name="restore">Restore Defaults</string>
|
||||||
<string name="delete_items">Delete Items</string>
|
<string name="delete_items">Delete Items</string>
|
||||||
|
<string name="remove_entry">Remove entry</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -13,12 +13,7 @@
|
|||||||
|
|
||||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||||
|
|
||||||
<style name="FUTheme" parent="Theme.AppCompat.Light.NoActionBar" >
|
<style name="FUTheme" parent="Theme.AppCompat.Light.NoActionBar" />
|
||||||
<item name="android:colorBackground">@color/colorFUGray</item>
|
|
||||||
<item name="colorPrimary">@color/colorFUGreen</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorFUGreenDark</item>
|
|
||||||
<item name="colorAccent">@color/colorFUBlue</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="FUTheme.itemTitle">
|
<style name="FUTheme.itemTitle">
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user