Ich mache ein Projekt im Android Studio, und ich brauche eine Navigationsschublade, machte ich eine Navigation, aber das Problem, ich kann es nicht schieben Sie links und rechts seinen Block ohne zu bewegen.Kann nicht Navigation Schublade schieben
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="radiofm.arabelradio.MainActivity"
android:background="#e10716"
>
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:menu="@menu/navigation_menu"
android:layout_gravity="start"
>
</android.support.design.widget.NavigationView>
<ImageButton
android:id="@+id/id_play"
android:layout_width="100dp"
android:layout_height="100dp"
android:scaleType="fitCenter"
android:background="#e10716"
android:layout_marginBottom="84dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<ImageView
android:id="@+id/imageView"
android:layout_width="250dp"
android:layout_height="100dp"
android:layout_marginTop="55dp"
app:srcCompat="@drawable/arabel"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
Mein Java-Code ich ein Projekt im Android Studio machte und ich brauche eine Navigationsleiste, machte ich eine Navigation, aber das Problem kann ich es nicht schieben links und rechts sein Block ohne
public class MainActivity extends AppCompatActivity {
ImageButton id_play;
MediaPlayer mediaPlayer;
boolean prepared = false;
boolean started =false;
String stream ="http://arabelfm.ice.infomaniak.ch/arabelprodcastfm.mp3";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
id_play = (ImageButton) findViewById(R.id.id_play);
id_play.setEnabled(false);
//id_play.setText("LOADING");
mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
new PlayerTask().execute(stream);
id_play.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (started){
started=false;
mediaPlayer.pause();
id_play.setImageResource(R.drawable.play);
// id_play.setText("PLAY");
}
else {
started=true;
mediaPlayer.start();
id_play.setImageResource(R.drawable.pause);
//id_play.setText("PAUSE");
}
}
});
}
fügen Sie Ihren Java-Code hinzu. –
wo ist dein [DrawerLayout] (https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html) – kId
@farhanpatel ich bearbeitet –