正在查看: Rilo v2.0.21 应用的 ImageAndVideoActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Rilo v2.0.21 应用的 ImageAndVideoActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.common.utils.custom.mediaslider;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.appcompat.app.ActionBar;
import androidx.fragment.app.FragmentTransaction;
import app.callpe.common.utils.Constants;
import app.callpe.databinding.ActivityImageAndVideoBinding;
import app.callpe.ui.home.BaseActivity;
import app.callpe.ui.home.ImageVideoUploadActivity;
import app.callpe.ui.home.profileTabFragments.PhotosFragment;
import dagger.hilt.android.AndroidEntryPoint;
import java.util.Objects;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import timber.log.Timber;
@Metadata(d1 = {"\u0000R\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0007\u0018\u0000 (2\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0001(B\u0005¢\u0006\u0002\u0010\u0003J\u0010\u0010\u0013\u001a\u00020\u00022\u0006\u0010\u0014\u001a\u00020\u0015H\u0016J\u0010\u0010\u0016\u001a\u00020\u00122\u0006\u0010\u0017\u001a\u00020\u0018H\u0002J\b\u0010\u0019\u001a\u00020\u001aH\u0016J\b\u0010\u001b\u001a\u00020\u001aH\u0002J\u0012\u0010\u001c\u001a\u00020\u001a2\b\u0010\u001d\u001a\u0004\u0018\u00010\u001eH\u0015J\b\u0010\u001f\u001a\u00020\u001aH\u0014J\u0010\u0010 \u001a\u00020\u00122\u0006\u0010!\u001a\u00020\"H\u0016J\b\u0010#\u001a\u00020\u001aH\u0014J\b\u0010$\u001a\u00020\u001aH\u0014J\b\u0010%\u001a\u00020\u001aH\u0003J\b\u0010&\u001a\u00020\u001aH\u0002J\b\u0010'\u001a\u00020\u001aH\u0002R\u001c\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\tR \u0010\n\u001a\b\u0012\u0004\u0012\u00020\f0\u000bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010R\u000e\u0010\u0011\u001a\u00020\u0012X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006)"}, d2 = {"Lapp/callpe/common/utils/custom/mediaslider/ImageAndVideoActivity;", "Lapp/callpe/ui/home/BaseActivity;", "Lapp/callpe/databinding/ActivityImageAndVideoBinding;", "()V", "fragment", "Lapp/callpe/ui/home/profileTabFragments/PhotosFragment;", "getFragment", "()Lapp/callpe/ui/home/profileTabFragments/PhotosFragment;", "setFragment", "(Lapp/callpe/ui/home/profileTabFragments/PhotosFragment;)V", "launcher", "Landroidx/activity/result/ActivityResultLauncher;", "Landroid/content/Intent;", "getLauncher", "()Landroidx/activity/result/ActivityResultLauncher;", "setLauncher", "(Landroidx/activity/result/ActivityResultLauncher;)V", "showTabs", "", "inflateLayout", "layoutInflater", "Landroid/view/LayoutInflater;", "isFragmentAdded", "tag", "", "onBackPressed", "", "onClick", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onOptionsItemSelected", "item", "Landroid/view/MenuItem;", "onPause", "onResume", "removeFragment", "setChipLayout", "setUpToolbar", "Companion", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class ImageAndVideoActivity extends BaseActivity<ActivityImageAndVideoBinding> {
public static final Companion INSTANCE = new Companion(null);
private static FinishActivityCallback finishCallback;
private PhotosFragment fragment;
private ActivityResultLauncher<Intent> launcher;
private boolean showTabs;
public ImageAndVideoActivity() {
ActivityResultLauncher<Intent> registerForActivityResult = registerForActivityResult((ActivityResultContract) new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
public final void onActivityResult(Object obj) {
ImageAndVideoActivity.launcher$lambda$0(ImageAndVideoActivity.this, (ActivityResult) obj);
}
});
Intrinsics.checkNotNullExpressionValue(registerForActivityResult, "registerForActivityResul…refresh()\n }\n }");
this.launcher = registerForActivityResult;
}
public final PhotosFragment getFragment() {
return this.fragment;
}
public final void setFragment(PhotosFragment photosFragment) {
this.fragment = photosFragment;
}
public final ActivityResultLauncher<Intent> getLauncher() {
return this.launcher;
}
public final void setLauncher(ActivityResultLauncher<Intent> activityResultLauncher) {
Intrinsics.checkNotNullParameter(activityResultLauncher, "<set-?>");
this.launcher = activityResultLauncher;
}
public static final void launcher$lambda$0(ImageAndVideoActivity imageAndVideoActivity, ActivityResult activityResult) {
PhotosFragment photosFragment;
Intrinsics.checkNotNullParameter(imageAndVideoActivity, "this$0");
Intrinsics.checkNotNullParameter(activityResult, "result");
if (activityResult.getResultCode() != -1 || (photosFragment = imageAndVideoActivity.fragment) == null) {
return;
}
photosFragment.refresh();
}
@Override
public ActivityImageAndVideoBinding inflateLayout(LayoutInflater layoutInflater) {
Intrinsics.checkNotNullParameter(layoutInflater, "layoutInflater");
ActivityImageAndVideoBinding inflate = ActivityImageAndVideoBinding.inflate(layoutInflater);
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
return inflate;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setChipLayout();
setUpToolbar();
onClick();
if (savedInstanceState == null) {
if (this.fragment == null) {
this.fragment = new PhotosFragment();
}
FragmentTransaction beginTransaction = getSupportFragmentManager().beginTransaction();
Intrinsics.checkNotNullExpressionValue(beginTransaction, "supportFragmentManager.beginTransaction()");
PhotosFragment photosFragment = this.fragment;
if (photosFragment != null) {
try {
photosFragment.setShowStatus(true);
if (isFragmentAdded(String.valueOf(photosFragment.getTag()))) {
return;
}
beginTransaction.add(getBinding().fragmentContainer.getId(), photosFragment, String.valueOf(photosFragment.getTag()));
beginTransaction.commit();
} catch (Exception e) {
Timber.e(e);
}
}
}
}
private final void setChipLayout() {
Intent intent = getIntent();
if (intent != null) {
this.showTabs = intent.getBooleanExtra("showTabs", false);
LinearLayout linearLayout = getBinding().chipLayout;
Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.chipLayout");
linearLayout.setVisibility(this.showTabs ? 0 : 8);
if (this.showTabs) {
getBinding().title.setText("My Profile & Gallery");
}
}
}
private final void setUpToolbar() {
try {
setSupportActionBar(getBinding().toolbar);
ActionBar actionBar = (ActionBar) Objects.requireNonNull(getSupportActionBar());
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
} catch (Exception e) {
Timber.tag("").e(e, "setUpToolbar: Error ", new Object[0]);
}
}
private final void onClick() {
getBinding().imageBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ImageAndVideoActivity.onClick$lambda$4(ImageAndVideoActivity.this, view);
}
});
getBinding().videoBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ImageAndVideoActivity.onClick$lambda$6(ImageAndVideoActivity.this, view);
}
});
getBinding().profileBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ImageAndVideoActivity.onClick$lambda$7(ImageAndVideoActivity.this, view);
}
});
}
public static final void onClick$lambda$4(ImageAndVideoActivity imageAndVideoActivity, View view) {
Intrinsics.checkNotNullParameter(imageAndVideoActivity, "this$0");
Intent intent = new Intent((Context) imageAndVideoActivity, (Class<?>) ImageVideoUploadActivity.class);
intent.putExtra("type", Constants.IMAGE);
imageAndVideoActivity.launcher.launch(intent);
}
public static final void onClick$lambda$6(ImageAndVideoActivity imageAndVideoActivity, View view) {
Intrinsics.checkNotNullParameter(imageAndVideoActivity, "this$0");
Intent intent = new Intent((Context) imageAndVideoActivity, (Class<?>) ImageVideoUploadActivity.class);
intent.putExtra("type", Constants.VIDEO);
imageAndVideoActivity.launcher.launch(intent);
}
public static final void onClick$lambda$7(ImageAndVideoActivity imageAndVideoActivity, View view) {
Intrinsics.checkNotNullParameter(imageAndVideoActivity, "this$0");
imageAndVideoActivity.finish();
imageAndVideoActivity.overridePendingTransition(0, 0);
}
private final void removeFragment() {
PhotosFragment photosFragment = this.fragment;
if (photosFragment != null) {
try {
if (isDestroyed()) {
return;
}
getSupportFragmentManager().beginTransaction().remove(photosFragment).commit();
} catch (Exception e) {
Timber.e(e);
}
}
}
protected void onPause() {
super.onPause();
}
protected void onResume() {
super.onResume();
}
protected void onDestroy() {
super.onDestroy();
if (isFinishing()) {
return;
}
removeFragment();
}
public boolean onOptionsItemSelected(MenuItem item) {
Intrinsics.checkNotNullParameter(item, "item");
if (item.getItemId() != 16908332) {
return true;
}
if (this.showTabs) {
FinishActivityCallback finishActivityCallback = finishCallback;
if (finishActivityCallback != null) {
finishActivityCallback.finishProfileActivity();
}
finish();
return true;
}
onBackPressed();
return true;
}
public void onBackPressed() {
if (this.showTabs) {
FinishActivityCallback finishActivityCallback = finishCallback;
if (finishActivityCallback != null) {
finishActivityCallback.finishProfileActivity();
}
finish();
return;
}
super.onBackPressed();
}
private final boolean isFragmentAdded(String tag) {
return getSupportFragmentManager().findFragmentByTag(tag) != null;
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u001c\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\b¨\u0006\t"}, d2 = {"Lapp/callpe/common/utils/custom/mediaslider/ImageAndVideoActivity$Companion;", "", "()V", "finishCallback", "Lapp/callpe/common/utils/custom/mediaslider/FinishActivityCallback;", "getFinishCallback", "()Lapp/callpe/common/utils/custom/mediaslider/FinishActivityCallback;", "setFinishCallback", "(Lapp/callpe/common/utils/custom/mediaslider/FinishActivityCallback;)V", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final FinishActivityCallback getFinishCallback() {
return ImageAndVideoActivity.finishCallback;
}
public final void setFinishCallback(FinishActivityCallback finishActivityCallback) {
ImageAndVideoActivity.finishCallback = finishActivityCallback;
}
}
}