...
This commit is contained in:
parent
6f90cb957c
commit
e4f7fb59c5
@ -13,6 +13,7 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
@ -21,9 +22,11 @@ import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
|
||||
@ -37,6 +40,7 @@ import androidx.navigation.Navigation;
|
||||
import androidx.navigation.ui.AppBarConfiguration;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@ -47,6 +51,8 @@ import java.util.Locale;
|
||||
|
||||
import de.jg_cody.Teraplex.ui.Credits.CreditsFragment;
|
||||
import de.jg_cody.Teraplex.ui.Einstellungen.EinstellungenFragment;
|
||||
import de.jg_cody.Teraplex.ui.Konsole.KonsoleFragment;
|
||||
import de.jg_cody.Teraplex.ui.home.HomeFragment;
|
||||
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements AddButtonDialog.AddButtonDialogListener {
|
||||
@ -85,25 +91,25 @@ public class MainActivity extends AppCompatActivity implements AddButtonDialog.A
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
toolbar.setBackgroundResource(R.drawable.toolbartop);
|
||||
setSupportActionBar(toolbar);
|
||||
// FloatingActionButton addfab = findViewById(R.id.addbutton_fab);
|
||||
// addfab.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// showChooseElement();
|
||||
// }
|
||||
// });
|
||||
FloatingActionButton addfab = findViewById(R.id.addbutton_fab);
|
||||
addfab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showChooseElement();
|
||||
}
|
||||
});
|
||||
|
||||
// FloatingActionButton mfab = findViewById(R.id.fab);
|
||||
// mfab.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// try {
|
||||
// Log.d("I", "ACTION BUTTON CLICKED");
|
||||
// SSH_connection.executeRemoteCommand(HomeFragment.ip, HomeFragment.user, HomeFragment.password, KonsoleFragment.command);
|
||||
// } catch (Exception e) {
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
FloatingActionButton mfab = findViewById(R.id.fab);
|
||||
mfab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
try {
|
||||
Log.d("I", "ACTION BUTTON CLICKED");
|
||||
SSH_connection.executeRemoteCommand(HomeFragment.ip, HomeFragment.user, HomeFragment.password, KonsoleFragment.command);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||
NavigationView navigationView = findViewById(R.id.nav_view);
|
||||
// Passing each menu ID as a set of Ids because each
|
||||
@ -313,4 +319,12 @@ public class MainActivity extends AppCompatActivity implements AddButtonDialog.A
|
||||
|
||||
return dest;
|
||||
}
|
||||
public static Bitmap createImage(int width, int height, int color) {
|
||||
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
Paint paint = new Paint();
|
||||
paint.setColor(color);
|
||||
canvas.drawRect(0F, 0F, (float) width, (float) height, paint);
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
|
@ -188,6 +188,8 @@ public class EinstellungenFragment extends Fragment {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}).create();
|
||||
mDialog.getWindow().setBackgroundDrawableResource(R.drawable.button_round);
|
||||
|
@ -20,7 +20,7 @@
|
||||
app:layout_anchor="@+id/include"
|
||||
app:layout_anchorGravity="center" />
|
||||
|
||||
<!-- <de.jg_cody.Teraplex.MovableFloatingActionButton
|
||||
<de.jg_cody.Teraplex.MovableFloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -37,7 +37,7 @@
|
||||
android:layout_marginVertical="70dp"
|
||||
android:background="@drawable/button_round"
|
||||
android:hapticFeedbackEnabled="true"
|
||||
android:src="@drawable/add_black_24dp" /> -->
|
||||
android:src="@drawable/add_black_24dp" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
@ -21,7 +21,7 @@
|
||||
android:title="@string/menu_zeitsteuerung" />
|
||||
|
||||
</group>
|
||||
<group >
|
||||
<group>
|
||||
<item
|
||||
android:id="@+id/nav_flur"
|
||||
android:title="@string/menu_flur" />
|
||||
@ -32,4 +32,12 @@
|
||||
android:id="@+id/nav_kueche"
|
||||
android:title="@string/menu_küche" />
|
||||
</group>
|
||||
<group android:checkableBehavior="single"
|
||||
android:id="@+id/Down">
|
||||
<item
|
||||
android:id="@+id/app_bar_switch"
|
||||
android:title="BEARBEITUNGSMODUS"
|
||||
app:actionLayout="@layout/switch_item"
|
||||
app:showAsAction="always" />
|
||||
</group>
|
||||
</menu>
|
Loading…
Reference in New Issue
Block a user