Skip to content

Commit

Permalink
アイコンを設定
Browse files Browse the repository at this point in the history
  • Loading branch information
multiverse2011 committed Mar 4, 2019
1 parent 413b4bc commit 86cabe5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
android:name=".FullscreenActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:theme="@style/FullscreenTheme">
android:theme="@style/FullscreenTheme"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.Toast;

/**
Expand All @@ -25,17 +26,10 @@ public class FullscreenActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fullscreen);
hideNavigationBar();

//下の戻るとかホームを消すやつ SDK19未満は不明
if (Build.VERSION.SDK_INT >= 19) {
View decor = this.getWindow().getDecorView();
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
} else {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

Button mButtonSpica = findViewById(R.id.button_spica);
Button mButtonSettings = findViewById(R.id.button_settings);
ImageButton mButtonSpica = findViewById(R.id.button_spica);
ImageButton mButtonSettings = findViewById(R.id.button_settings);

mButtonSpica.setOnClickListener(new View.OnClickListener() {
@Override
Expand All @@ -62,9 +56,16 @@ public void onClick(View v) {
@Override
protected void onResume() {
super.onResume();
hideNavigationBar();
}

private void hideNavigationBar() {
//下の戻るとかホームを消すやつ SDK19未満は不明
if (Build.VERSION.SDK_INT >= 19) {
View decor = this.getWindow().getDecorView();
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
} else {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
}
Binary file added app/src/main/res/drawable/setting_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/spica_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions app/src/main/res/layout/activity_fullscreen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,23 @@
android:layout_height="match_parent"
android:orientation="horizontal">

<Button
<ImageButton
android:id="@+id/button_spica"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_weight="1"
android:scaleType="fitCenter"
android:src="@drawable/spica_icon"
android:text="@string/launch_spica" />

<Button
<ImageButton
android:id="@+id/button_settings"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:src="@drawable/setting_icon"

android:text="@string/launch_settings" />
</LinearLayout>
</FrameLayout>

0 comments on commit 86cabe5

Please sign in to comment.