Arg取得 WIP

This commit is contained in:
r-ca 2024-01-20 17:21:48 +09:00
parent 1aa41eb638
commit 646a97e77b
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -1,15 +1,43 @@
package one.nem.lacerta.component.viewer; package one.nem.lacerta.component.viewer;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import androidx.activity.EdgeToEdge; import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets; import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat; import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.FragmentManager;
import androidx.navigation.NavController;
import androidx.navigation.fragment.NavHostFragment;
import androidx.navigation.ui.NavigationUI;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import javax.inject.Inject;
import dagger.hilt.android.AndroidEntryPoint;
import one.nem.lacerta.utils.LacertaLogger;
@AndroidEntryPoint
public class ViewerMainActivity extends AppCompatActivity { public class ViewerMainActivity extends AppCompatActivity {
LacertaLogger logger;
@Inject
public ViewerMainActivity(LacertaLogger logger) {
this.logger = logger;
logger.debug(TAG, "ViewerMainActivity created");
}
// Variables
private static final String TAG = "ViewerMainActivity";
String documentId;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -20,5 +48,16 @@ public class ViewerMainActivity extends AppCompatActivity {
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets; return insets;
}); });
Intent intent = getIntent();
try {
documentId = intent.getStringExtra("documentId");
}
catch (Exception e) {
logger.error(TAG, "Failed to get documentId from intent");
logger.error(TAG, "Searchable Error code: " + "f64c21a2-391f-4c40-92f6-183da459de21");
Toast.makeText(this, "Failed to get documentId from intent", Toast.LENGTH_LONG).show();
finish();
}
} }
} }