mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
t/oxr_android: Add fragment to the main activity
This commit is contained in:
parent
03a129a4ea
commit
36fa605ab4
|
@ -13,6 +13,8 @@ import android.text.method.LinkMovementMethod;
|
|||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
|
@ -23,5 +25,13 @@ public class MainActivity extends AppCompatActivity {
|
|||
// Make our Monado link clickable
|
||||
((TextView) findViewById(R.id.textPowered)).setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||
|
||||
@VrModeStatus.Status
|
||||
int status = VrModeStatus.detectStatus(this, BuildConfig.APPLICATION_ID);
|
||||
VrModeStatus statusFrag = VrModeStatus.newInstance(status);
|
||||
fragmentTransaction.add(R.id.statusFrame, statusFrag, null);
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue