new videoformat for older androidversions

This commit is contained in:
JG-Cody 2021-07-11 16:01:38 +02:00
parent 86cf510bca
commit 37eb20e330
3 changed files with 1 additions and 169 deletions

View File

@ -7,7 +7,6 @@ import android.content.SharedPreferences;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.media.MediaPlayer;
import android.os.Build;
import android.os.Bundle;
import android.os.Vibrator;
import android.util.Base64;
@ -21,7 +20,6 @@ import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
@ -29,7 +27,6 @@ import java.util.Objects;
import de.jg_cody.Teraplex.MainActivity;
import de.jg_cody.Teraplex.R;
import de.jg_cody.Teraplex.SSH_connection;
public class HomeFragment extends Fragment {
@ -146,56 +143,7 @@ public class HomeFragment extends Fragment {
requireActivity().finish();
}
});
wlan_aus_Button = (Button) root.findViewById(R.id.wlan_aus);
wlan_aus_Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "WLAN wird ausgeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "service hostapd stop");
} catch (Exception ignored) {
}
}
});
wlan_an_Button = (Button) root.findViewById(R.id.wlan_an);
wlan_an_Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "WLAN wird eingeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "service hostapd start");
} catch (Exception ignored) {
}
}
});
kodiaus = (Button) root.findViewById(R.id.kodiaus);
kodiaus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "KODI wird ausgeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "sudo /root/raspberry-remote/send 11111 3 0");
} catch (Exception ignored) {
}
}
});
kodian = (Button) root.findViewById(R.id.kodian);
kodian.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "KODI wird angeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "sudo /root/raspberry-remote/send 11111 3 1");
} catch (Exception ignored) {
}
}
});
return root;
}
}

View File

@ -41,28 +41,11 @@
app:layout_constraintStart_toStartOf="@+id/text_home"
app:layout_constraintTop_toTopOf="@+id/text_home" />
<ImageView
android:id="@drawable/backgroundoverlay"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="-25dp"
android:layout_marginLeft="-25dp"
android:layout_marginTop="-25dp"
android:layout_marginEnd="-25dp"
android:layout_marginRight="-25dp"
android:layout_marginBottom="-25dp"
android:scaleType="centerCrop"
android:src="@drawable/backgroundoverlay"
app:layout_constraintBottom_toBottomOf="@+id/textView7"
app:layout_constraintEnd_toEndOf="@+id/wlan_aus"
app:layout_constraintStart_toStartOf="@+id/wlan_an"
app:layout_constraintTop_toTopOf="@+id/textView5" />
<TextView
android:id="@+id/text_home"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:layout_marginTop="200dp"
android:gravity="center_horizontal"
android:text="@string/Welcome_to_your_HOMEAUTOMATION_APP"
android:textAlignment="center"
@ -159,105 +142,6 @@
app:layout_constraintEnd_toEndOf="@+id/text_home"
app:layout_constraintTop_toBottomOf="@+id/loginpasswordInput" />
<Button
android:id="@+id/wlan_aus"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:background="@drawable/button_right"
android:drawableRight="@drawable/signal_wifi_off_24px"
android:drawableTint="@color/mtrl_btn_text_color_selector"
android:hapticFeedbackEnabled="true"
android:text="@string/off"
app:backgroundTint="@null"
app:layout_constraintBottom_toBottomOf="@+id/textView5"
app:layout_constraintStart_toEndOf="@+id/textView5"
app:layout_constraintTop_toTopOf="@+id/textView5" />
<Button
android:id="@+id/kodiaus"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:background="@drawable/button_right"
android:drawableRight="@drawable/kodi_aus_1_"
android:drawableTint="@color/mtrl_btn_text_color_selector"
android:hapticFeedbackEnabled="true"
android:text="@string/off"
app:backgroundTint="@null"
app:layout_constraintBottom_toBottomOf="@+id/textView7"
app:layout_constraintStart_toEndOf="@+id/textView7"
app:layout_constraintTop_toTopOf="@+id/textView7" />
<Button
android:id="@+id/wlan_an"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/button_left"
android:drawableLeft="@drawable/signal_wifi_statusbar_4_bar_24px"
android:drawableTint="@color/mtrl_btn_text_color_selector"
android:hapticFeedbackEnabled="true"
android:text="@string/on"
app:backgroundTint="@null"
app:layout_constraintBottom_toBottomOf="@+id/textView5"
app:layout_constraintEnd_toStartOf="@+id/textView5"
app:layout_constraintTop_toTopOf="@+id/textView5" />
<Button
android:id="@+id/kodian"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/button_left"
android:drawableLeft="@drawable/kodi"
android:drawableTint="@color/mtrl_btn_text_color_selector"
android:hapticFeedbackEnabled="true"
android:text="@string/on"
app:backgroundTint="@null"
app:layout_constraintBottom_toBottomOf="@+id/textView7"
app:layout_constraintEnd_toStartOf="@+id/textView7"
app:layout_constraintTop_toTopOf="@+id/textView7" />
<TextView
android:id="@+id/textView5"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_marginTop="50dp"
android:background="@drawable/button_middle"
android:gravity="center"
android:text="@string/wlan"
android:textAlignment="center"
android:textColor="@color/mtrl_btn_text_color_selector"
android:textSize="14sp"
app:layout_constraintBottom_toTopOf="@+id/textView7"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.485"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/loginButton" />
<TextView
android:id="@+id/textView7"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_marginBottom="25dp"
android:background="@drawable/button_middle"
android:gravity="center"
android:text="@string/kodi"
android:textAlignment="center"
android:textColor="@color/mtrl_btn_text_color_selector"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.485"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView5" />
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.