App compatibility for Kitkat devices
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package de.sebse.fuplanner.services.kvv;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
@@ -89,6 +90,11 @@ public class ModulesEvents extends PartModules<EventList> {
|
||||
|
||||
@Override
|
||||
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()) {
|
||||
errorCallback.onError(new NetworkError(101414, 500, "Currently running in offline mode!"));
|
||||
return;
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.view.animation.Animation;
|
||||
import android.view.animation.RotateAnimation;
|
||||
import android.view.animation.Transformation;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.LayoutRes;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -63,6 +64,8 @@ public class ExpandableCardView extends CardView {
|
||||
private int collapsedHeight = 0;
|
||||
private int expandedHeight = 0;
|
||||
|
||||
LayoutParams layoutParamsPreset = new LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
private OnExpandedListener listener;
|
||||
private final Logger log = new Logger(this);
|
||||
|
||||
@@ -176,12 +179,14 @@ public class ExpandableCardView extends CardView {
|
||||
|
||||
widthMeasure = atMostExactlySpec(Math.max(0, MeasureSpec.getSize(widthMeasureSpec)-imageButton.getMeasuredWidth()), widthMeasureSpec);
|
||||
heightMeasure = atMostSpec(MeasureSpec.getSize(heightMeasureSpec), heightMeasureSpec);
|
||||
outerView.setLayoutParams(layoutParamsPreset);
|
||||
outerView.measure(widthMeasure, heightMeasure);
|
||||
desiredWidth = imageButton.getMeasuredWidth() + outerView.getMeasuredWidth();
|
||||
desiredHeight = Math.max(imageButton.getMeasuredHeight(), outerView.getMeasuredHeight());
|
||||
|
||||
widthMeasure = atMostSpec(MeasureSpec.getSize(widthMeasureSpec), widthMeasureSpec);
|
||||
heightMeasure = atMostSpec(Math.max(0, MeasureSpec.getSize(heightMeasureSpec)-desiredHeight), heightMeasureSpec);
|
||||
innerView.setLayoutParams(layoutParamsPreset);
|
||||
innerView.measure(widthMeasure, heightMeasure);
|
||||
desiredWidth = Math.max(desiredWidth, innerView.getMeasuredWidth());
|
||||
desiredHeight += innerView.getMeasuredHeight();
|
||||
|
||||
Reference in New Issue
Block a user