mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-29 19:13:16 +00:00
ロジック実装 WIP
This commit is contained in:
parent
57c93abeef
commit
e5bfd5142b
|
@ -7,14 +7,31 @@ import androidx.fragment.app.Fragment;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.intellij.lang.annotations.JdkConstants;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import dagger.hilt.android.AndroidEntryPoint;
|
||||||
|
|
||||||
|
import one.nem.lacerta.data.repository.DebugFunc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple {@link Fragment} subclass.
|
* A simple {@link Fragment} subclass.
|
||||||
* Use the {@link DebugRepositoryDebuggerFragment#newInstance} factory method to
|
* Use the {@link DebugRepositoryDebuggerFragment#newInstance} factory method to
|
||||||
* create an instance of this fragment.
|
* create an instance of this fragment.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@AndroidEntryPoint
|
||||||
public class DebugRepositoryDebuggerFragment extends Fragment {
|
public class DebugRepositoryDebuggerFragment extends Fragment {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DebugFunc debugFunc;
|
||||||
|
|
||||||
public DebugRepositoryDebuggerFragment() {
|
public DebugRepositoryDebuggerFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
}
|
}
|
||||||
|
@ -42,6 +59,17 @@ public class DebugRepositoryDebuggerFragment extends Fragment {
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
EditText editTextRepoId = view.findViewById(R.id.editTextRepoId);
|
||||||
|
|
||||||
|
view.findViewById(R.id.buttonGenerateRepoId).setOnClickListener(v -> {
|
||||||
|
editTextRepoId.setText(UUID.randomUUID().toString()); //Generate random UUID
|
||||||
|
Toast.makeText(getContext(), "Generated random UUID", Toast.LENGTH_SHORT).show();
|
||||||
|
});
|
||||||
|
|
||||||
|
view.findViewById(R.id.buttonGetCreateRepository).setOnClickListener(v -> {
|
||||||
|
String repoId = editTextRepoId.getText().toString();
|
||||||
|
Repository repo = debugFunc.getOrCreateRepositoryById(repoId);
|
||||||
|
Toast.makeText(getContext(), "Get or create repository: " + repoId, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user