Ripristinati template
This commit is contained in:
parent
7ecf9e4807
commit
b6abeee972
97
.idea/fileTemplates/Android Activity.java
generated
Normal file
97
.idea/fileTemplates/Android Activity.java
generated
Normal file
@ -0,0 +1,97 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
|
||||
public class ${NAME}Activity extends BaseActivity {
|
||||
|
||||
/*
|
||||
- Create the following layout resource file [activity_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<data>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
|
||||
|
||||
|
||||
|
||||
- Create an entry in AndroidManifest.xml
|
||||
Fix the android:name tag with current path
|
||||
|
||||
<activity
|
||||
android:name="${NAME}Activity"
|
||||
android:label="@string/activity_${dashName}_title"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Activity${NAME}Binding mBindings;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static void startActivity(Context context) {
|
||||
Intent myIntent = new Intent(context, ${NAME}Activity.class);
|
||||
|
||||
//String keyExtraItem = DataCache.addItem(var);
|
||||
//myIntent.putExtra("keyExtraItem", keyExtraItem);
|
||||
|
||||
context.startActivity(myIntent);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
//mBindings = DataBindingUtil.setContentView(this, R.layout.activity_${dashName});
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
${NAME}Component.Factory ${variableName}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.${variableName}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Activity.java.child.0.java
generated
Normal file
12
.idea/fileTemplates/Android Activity.java.child.0.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = ${NAME}Component.class)
|
||||
public class ${NAME}Module {
|
||||
|
||||
@Provides
|
||||
${NAME}ViewModel provides${NAME}ViewModel() {
|
||||
return new ${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Activity.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Activity.java.child.1.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(${NAME}Activity ${NAME}Activity);
|
||||
}
|
||||
3
.idea/fileTemplates/Android Activity.java.child.2.java
generated
Normal file
3
.idea/fileTemplates/Android Activity.java.child.2.java
generated
Normal file
@ -0,0 +1,3 @@
|
||||
public class ${NAME}ViewModel {
|
||||
|
||||
}
|
||||
125
.idea/fileTemplates/Android Dialog.java
generated
Normal file
125
.idea/fileTemplates/Android Dialog.java
generated
Normal file
@ -0,0 +1,125 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
|
||||
public class Dialog${NAME}View extends BaseDialogFragment {
|
||||
|
||||
/*
|
||||
Create the following layout resource file [dialog_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="16dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:src="@drawable/ic_error_white_24dp"
|
||||
app:tint="?colorPrimary" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Title here" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/description_text"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="Description here" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
Dialog${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Dialog${NAME}Binding mBindings;
|
||||
private Context mContext;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static Dialog${NAME}View newInstance() {
|
||||
return new Dialog${NAME}View();
|
||||
}
|
||||
|
||||
private Dialog${NAME}View() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
this.mContext = requireContext();
|
||||
|
||||
//mBindings = Dialog${NAME}Binding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
Dialog${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
Dialog${NAME}Component.Factory dialog${NAME}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.dialog${NAME}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
setCancelable(false);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(isCancelable())
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Dialog.java.child.0.java
generated
Normal file
12
.idea/fileTemplates/Android Dialog.java.child.0.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = Dialog${NAME}Component.class)
|
||||
public class Dialog${NAME}Module {
|
||||
|
||||
@Provides
|
||||
Dialog${NAME}ViewModel providesDialog${NAME}ViewModel() {
|
||||
return new Dialog${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Dialog.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Dialog.java.child.1.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface Dialog${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
Dialog${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(Dialog${NAME}View dialog${NAME}View);
|
||||
}
|
||||
3
.idea/fileTemplates/Android Dialog.java.child.2.java
generated
Normal file
3
.idea/fileTemplates/Android Dialog.java.child.2.java
generated
Normal file
@ -0,0 +1,3 @@
|
||||
public class Dialog${NAME}ViewModel {
|
||||
|
||||
}
|
||||
82
.idea/fileTemplates/Android Fragment.java
generated
Normal file
82
.idea/fileTemplates/Android Fragment.java
generated
Normal file
@ -0,0 +1,82 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
|
||||
public class ${NAME}Fragment extends BaseFragment {
|
||||
|
||||
/*
|
||||
- Create the following layout resource file [fragment_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<data>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Fragment${NAME}Binding mBindings;
|
||||
|
||||
|
||||
public ${NAME}Fragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static ${NAME}Fragment newInstance() {
|
||||
return new ${NAME}Fragment();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
setRetainInstance(true);
|
||||
|
||||
//mBindings = Fragment${NAME}Binding.inflate(inflater, container, false);
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
${NAME}Component.Factory ${variableName}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.${variableName}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
}
|
||||
3
.idea/fileTemplates/Android Fragment.java.child.0.java
generated
Normal file
3
.idea/fileTemplates/Android Fragment.java.child.0.java
generated
Normal file
@ -0,0 +1,3 @@
|
||||
public class ${NAME}ViewModel {
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Fragment.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Fragment.java.child.1.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(${NAME}Fragment ${NAME}Fragment);
|
||||
}
|
||||
12
.idea/fileTemplates/Android Fragment.java.child.2.java
generated
Normal file
12
.idea/fileTemplates/Android Fragment.java.child.2.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = ${NAME}Component.class)
|
||||
public class ${NAME}Module {
|
||||
|
||||
@Provides
|
||||
${NAME}ViewModel provides${NAME}ViewModel() {
|
||||
return new ${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user