89 lines
3.2 KiB
Java
89 lines
3.2 KiB
Java
package com.ubt.jimu.diy.view;
|
|
|
|
import android.R;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import androidx.fragment.app.FragmentTransaction;
|
|
import com.ubt.jimu.BaseActivity;
|
|
import com.ubt.jimu.diy.view.fragment.BuildStepFragment;
|
|
import com.ubt.jimu.diy.view.fragment.DiyPartAllFragment;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class FragmentCopyLoadActivity extends BaseActivity {
|
|
private String Type = "type";
|
|
private Fragment mFragment;
|
|
|
|
public static void start(Context context, String str) {
|
|
Intent intent = new Intent(context, (Class<?>) FragmentCopyLoadActivity.class);
|
|
intent.putExtra("type", str);
|
|
context.startActivity(intent);
|
|
}
|
|
|
|
private void transFrag(String str) {
|
|
char c;
|
|
FragmentManager supportFragmentManager = getSupportFragmentManager();
|
|
int hashCode = str.hashCode();
|
|
if (hashCode != 164947626) {
|
|
if (hashCode == 1379508746 && str.equals("DiyPartAllFragment")) {
|
|
c = 0;
|
|
}
|
|
c = 65535;
|
|
} else {
|
|
if (str.equals("BuildStepFragment")) {
|
|
c = 1;
|
|
}
|
|
c = 65535;
|
|
}
|
|
if (c == 0) {
|
|
DiyPartAllFragment create = DiyPartAllFragment.create(getIntent().getIntExtra("count", 0), getIntent().getStringExtra(BuildStepFragment.UUID));
|
|
FragmentTransaction a = supportFragmentManager.a();
|
|
a.b(R.id.content, create);
|
|
a.a();
|
|
return;
|
|
}
|
|
if (c != 1) {
|
|
return;
|
|
}
|
|
FragmentTransaction a2 = supportFragmentManager.a();
|
|
a2.b(R.id.content, BuildStepFragment.create(getIntent().getStringExtra(BuildStepFragment.UUID)));
|
|
a2.a();
|
|
}
|
|
|
|
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
|
protected void onActivityResult(int i, int i2, Intent intent) {
|
|
super.onActivityResult(i, i2, intent);
|
|
Fragment fragment = this.mFragment;
|
|
if (fragment != null) {
|
|
fragment.onActivityResult(i, i2, intent);
|
|
}
|
|
}
|
|
|
|
@Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
|
protected void onCreate(Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
transFrag(getIntent().getStringExtra(this.Type));
|
|
}
|
|
|
|
@Override // com.ubt.jimu.BaseActivity
|
|
public void relayout() {
|
|
}
|
|
|
|
public static void start(Context context, String str, String str2) {
|
|
Intent intent = new Intent(context, (Class<?>) FragmentCopyLoadActivity.class);
|
|
intent.putExtra("type", str);
|
|
intent.putExtra(BuildStepFragment.UUID, str2);
|
|
context.startActivity(intent);
|
|
}
|
|
|
|
public static void start(Context context, int i, String str, String str2) {
|
|
Intent intent = new Intent(context, (Class<?>) FragmentCopyLoadActivity.class);
|
|
intent.putExtra("count", i);
|
|
intent.putExtra("type", str);
|
|
intent.putExtra(BuildStepFragment.UUID, str2);
|
|
context.startActivity(intent);
|
|
}
|
|
}
|