Initial import of ADIF API reverse-engineering toolkit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.adif.elcanomovil.extensions;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u0006\n\u0000\n\u0002\u0010\b\n\u0000\u001a\u0014\u0010\u0000\u001a\u00020\u0001*\u00020\u00012\b\b\u0002\u0010\u0002\u001a\u00020\u0003¨\u0006\u0004"}, d2 = {"round", "", "decimals", "", "common-resources_proNon_corporateRelease"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class DoubleExtensionsKt {
|
||||
public static final double round(double d4, int i) {
|
||||
String format = String.format(Locale.ENGLISH, "%." + i + 'f', Arrays.copyOf(new Object[]{Double.valueOf(d4)}, 1));
|
||||
Intrinsics.checkNotNullExpressionValue(format, "format(...)");
|
||||
return Double.parseDouble(format);
|
||||
}
|
||||
|
||||
public static /* synthetic */ double round$default(double d4, int i, int i4, Object obj) {
|
||||
if ((i4 & 1) != 0) {
|
||||
i = 1;
|
||||
}
|
||||
return round(d4, i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.adif.elcanomovil.extensions;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u000e\n\u0002\u0010\u0007\n\u0002\b\u0002\u001a\n\u0010\u0000\u001a\u00020\u0001*\u00020\u0002\u001a\n\u0010\u0003\u001a\u00020\u0001*\u00020\u0002¨\u0006\u0004"}, d2 = {"toDistance", "", "", "toDuration", "common-resources_proNon_corporateRelease"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FloatExtensionsKt {
|
||||
public static final String toDistance(float f2) {
|
||||
if (f2 > 1000000.0f) {
|
||||
return "> 1.000 km";
|
||||
}
|
||||
if (f2 > 1000.0f) {
|
||||
return new DecimalFormat("##.##").format(Float.valueOf(f2 / 1000)) + " km";
|
||||
}
|
||||
if (f2 < 50.0f) {
|
||||
return "< 50 m";
|
||||
}
|
||||
return new DecimalFormat("##").format(Float.valueOf(f2)) + " m";
|
||||
}
|
||||
|
||||
public static final String toDuration(float f2) {
|
||||
int i = (int) f2;
|
||||
int i4 = (i / 60) % 60;
|
||||
int i5 = (i / 3600) % 24;
|
||||
if (i5 > 24) {
|
||||
return "> 24 h";
|
||||
}
|
||||
if (i5 <= 0) {
|
||||
return new DecimalFormat("##").format(Integer.valueOf(i4)) + " min";
|
||||
}
|
||||
if (i4 <= 0) {
|
||||
return new DecimalFormat("##").format(Integer.valueOf(i4)) + " h";
|
||||
}
|
||||
return new DecimalFormat("##").format(Integer.valueOf(i5)) + " h " + new DecimalFormat("##").format(Integer.valueOf(i4)) + " m";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.adif.elcanomovil.extensions;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\u001a\u0012\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004¨\u0006\u0005"}, d2 = {"shareLink", "", "Landroid/content/Context;", "msg", "", "common-resources_proNon_corporateRelease"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FragmentExtensionsKt {
|
||||
public static final void shareLink(Context context, String msg) {
|
||||
Intrinsics.checkNotNullParameter(context, "<this>");
|
||||
Intrinsics.checkNotNullParameter(msg, "msg");
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("android.intent.action.SEND");
|
||||
intent.putExtra("android.intent.extra.TEXT", msg);
|
||||
intent.putExtra("android.intent.extra.SUBJECT", msg);
|
||||
intent.setType("text/plain");
|
||||
context.startActivity(Intent.createChooser(intent, msg));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.adif.elcanomovil.extensions;
|
||||
|
||||
import android.location.Location;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\n\u0010\u0000\u001a\u00020\u0001*\u00020\u0002\u001a\n\u0010\u0003\u001a\u00020\u0001*\u00020\u0002\u001a\n\u0010\u0003\u001a\u00020\u0001*\u00020\u0001¨\u0006\u0004"}, d2 = {"toLatLng", "Lcom/google/android/gms/maps/model/LatLng;", "Landroid/location/Location;", "toLatLngTranslatedToSouth", "common-resources_proNon_corporateRelease"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LocationExtensionsKt {
|
||||
public static final LatLng toLatLng(Location location) {
|
||||
Intrinsics.checkNotNullParameter(location, "<this>");
|
||||
return new LatLng(location.getLatitude(), location.getLongitude());
|
||||
}
|
||||
|
||||
public static final LatLng toLatLngTranslatedToSouth(Location location) {
|
||||
Intrinsics.checkNotNullParameter(location, "<this>");
|
||||
return new LatLng(location.getLatitude() - 0.012d, location.getLongitude());
|
||||
}
|
||||
|
||||
public static final LatLng toLatLngTranslatedToSouth(LatLng latLng) {
|
||||
Intrinsics.checkNotNullParameter(latLng, "<this>");
|
||||
return new LatLng(latLng.latitude - 0.012d, latLng.longitude);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.adif.elcanomovil.extensions;
|
||||
|
||||
import android.widget.TextView;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u0012\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004\u001a\n\u0010\u0005\u001a\u00020\u0001*\u00020\u0002\u001a\n\u0010\u0006\u001a\u00020\u0001*\u00020\u0007\u001a\n\u0010\b\u001a\u00020\u0001*\u00020\u0007¨\u0006\t"}, d2 = {"addLeftDrawable", "", "Landroid/widget/TextView;", "drawable", "", "clearDrawables", "setLeftIcon", "Lcom/google/android/material/button/MaterialButton;", "setRightIcon", "common-resources_proNon_corporateRelease"}, k = 2, mv = {1, 9, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewExtKt {
|
||||
public static final void addLeftDrawable(TextView textView, int i) {
|
||||
Intrinsics.checkNotNullParameter(textView, "<this>");
|
||||
textView.setCompoundDrawablesWithIntrinsicBounds(i, 0, 0, 0);
|
||||
}
|
||||
|
||||
public static final void clearDrawables(TextView textView) {
|
||||
Intrinsics.checkNotNullParameter(textView, "<this>");
|
||||
textView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
public static final void setLeftIcon(MaterialButton materialButton) {
|
||||
Intrinsics.checkNotNullParameter(materialButton, "<this>");
|
||||
materialButton.setCompoundDrawablesRelative(materialButton.getIcon(), null, null, null);
|
||||
}
|
||||
|
||||
public static final void setRightIcon(MaterialButton materialButton) {
|
||||
Intrinsics.checkNotNullParameter(materialButton, "<this>");
|
||||
materialButton.setCompoundDrawablesRelative(null, null, materialButton.getIcon(), null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user