mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 00:29:50 -04:00
Refactor ConsoleFragment.java
This commit is contained in:
parent
6fe447410c
commit
668b49eeb8
@ -2,6 +2,7 @@ package net.kdt.pojavlaunch.fragments;
|
|||||||
|
|
||||||
import android.os.*;
|
import android.os.*;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import android.view.*;
|
import android.view.*;
|
||||||
import android.widget.*;
|
import android.widget.*;
|
||||||
@ -12,34 +13,33 @@ import android.graphics.*;
|
|||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
public class ConsoleFragment extends Fragment
|
public class ConsoleFragment extends Fragment {
|
||||||
{
|
public TextView mConsoleView;
|
||||||
public TextView consoleView;
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
super.onCreateView(inflater, container, savedInstanceState);
|
super.onCreateView(inflater, container, savedInstanceState);
|
||||||
View view = inflater.inflate(R.layout.lmaintab_consolelog, container, false);
|
View view = inflater.inflate(R.layout.lmaintab_consolelog, container, false);
|
||||||
|
|
||||||
consoleView = (TextView) view.findViewById(R.id.lmaintabconsoleLogTextView);
|
mConsoleView = (TextView) view.findViewById(R.id.lmaintabconsoleLogTextView);
|
||||||
consoleView.setTypeface(Typeface.MONOSPACE);
|
mConsoleView.setTypeface(Typeface.MONOSPACE);
|
||||||
consoleView.setHint(this.getText(R.string.main_nolog));
|
mConsoleView.setHint(this.getText(R.string.main_nolog));
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume() {
|
||||||
{
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
consoleView = (TextView) getView().findViewById(R.id.lmaintabconsoleLogTextView);
|
mConsoleView = (TextView) getView().findViewById(R.id.lmaintabconsoleLogTextView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void putLog(String str) {
|
public void putLog(String str) {
|
||||||
if (consoleView == null) {
|
if (mConsoleView == null) {
|
||||||
consoleView = (TextView) getView().findViewById(R.id.lmaintabconsoleLogTextView);
|
mConsoleView = (TextView) getView().findViewById(R.id.lmaintabconsoleLogTextView);
|
||||||
}
|
}
|
||||||
|
|
||||||
consoleView.append(str);
|
mConsoleView.append(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user