Zum Inhalt springen

b0mmell

Mitglieder
  • Gesamte Inhalte

    94
  • Benutzer seit

  • Letzter Besuch

  1. Vielen Dank schon einmal. Ich habe noch programmr.com gefunden, falls es jemanden interessiert Wir können den Thread ja einfach mal laufen lassen, vielleicht bekommen wir dann irgendwann eine gute Sammlung zusammen Über weitere Tipps würde ich mich freuen.
  2. Hi, Danke schonmal Sieht wirklich gut aus, kostet allerdings etwas :/ Gibt es eventuell auch kostenlose Seiten?
  3. Hi, Danke schonmal für die Antworten. Sorry, ich meine Kurse zum interaktiven Lernen von Programmiersprachen. So wie Codeacademy. Nur leider gibt es z.B. keine Java-Kurse auf codeacademy. Von Microsoft gibt es auch ein ähnliches, kostenloses Programm, was ich jetzt gefunden habe. Außerdem bin ich auf teamtreehouse gestoßen, was allerdings monatliche Gebühren kostet. Ich bedanke mich schonmal für eure Hilfe.
  4. Hallo, Ich bin auf der Suche nach online Kursen, die ähnlich aufgebaut sind wie codeacademy.com. Kann mir jemand vielleicht hierbei helfen und gute Seiten nennen, die solche Kurse anbieten? Ich hoffe, dass ich hier in dem Unterforum richtig bin, falls nicht, bitte ich dies zu Entschuldigen. Danke schon einmal im Voraus Viele Grüße,
  5. Ich habe jetzt nochmals eine Test-App erstellt, welche nun auch funktioniert. Allerdings habe ich jetzt die beiden Fragmente nicht in einem Contaier, inflate sie also direkt in der MainActivity, was ich ja bei der richtigen App eigentlich nicht möchte. Weiß jemand vielleicht, wie es doch mithilfe eines Containers geht? Hier mal der Code: MainActivity: package com.example.uitestapp; import android.os.Bundle; import android.app.Activity; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTransaction; import android.view.Menu; public class MainActivity extends FragmentActivity { FragmentLeft myLeftFragment = new FragmentLeft(); FragmentRight myRightFragment = new FragmentRight(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); includeFragment(myLeftFragment, R.id.container_left); includeFragment(myRightFragment, R.id.container_right); } private void includeFragment(Fragment fragment, int viewID) { FragmentTransaction transLeft = getSupportFragmentManager() .beginTransaction(); transLeft.replace(viewID, fragment).commit(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } } Portrait XML: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <!-- Main Content --> <FrameLayout android:id="@+id/container_right" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <!-- Drawer --> <FrameLayout android:id="@+id/container_left" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="#111" /> </android.support.v4.widget.DrawerLayout> Layout Landscape <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <FrameLayout android:id="@+id/container_left" android:layout_width="300dp" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:layout_centerVertical="true" /> <FrameLayout android:id="@+id/container_right" android:layout_width="500dp" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:layout_centerVertical="true" /> </RelativeLayout> Die Fragmente sind in diesem Beispiel noch ohne Inhalt, ich habe also einfach nur zum Test einen Hintergrund erstellt. Jetzt möchte ich aber in der Main statt der beiden FrameLayouts nur ein Layout, in dem ich dann ein Container-Fragment inflate, welches die beiden anderen Fragmente beinhalten soll. Beim Wechsel in den Portrait Modus soll dieses durch FragmentB ersetzt werden und FragmentA in den Container. Außerdem hätte ich noch die Frage, ob es vielleicht gute Quellen um an Android Informationen zu kommen, gibt. Im Android IRC Channel ist leider nicht wirklich viel los und gute Foren scheint es auch nicht zu geben, oder irre ich mich da ? Ich würde mich über Tipps sehr freuen Viele Grüße,
  6. package com.example.navigationdrawerdemoapp; import android.os.Bundle; import android.app.Activity; import android.content.res.Configuration; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTransaction; import android.support.v4.widget.DrawerLayout; import android.util.Log; import android.view.Menu; import android.view.View; import android.widget.FrameLayout; import android.widget.ListView; public class NavigationDrawerMainActivity extends FragmentActivity { private DrawerLayout myDrawerLayout; private FrameLayout myDrawerList; int orientation = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_navigation_drawer_main); includeFragments(); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); orientation = newConfig.orientation; switch (orientation) { case Configuration.ORIENTATION_LANDSCAPE: includeFragments(); break; case Configuration.ORIENTATION_PORTRAIT: myDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); myDrawerList = (FrameLayout) findViewById(R.id.left_drawer); FragmentB fragmentB = new FragmentB(); FragmentTransaction transPortr = getSupportFragmentManager().beginTransaction(); transPortr.replace(R.id.container, fragmentB); transPortr.commit(); FragmentA fragmentA = new FragmentA(); FragmentTransaction transPortrA = getSupportFragmentManager().beginTransaction(); transPortrA.replace(R.id.left_drawer, fragmentA); transPortrA.commit(); Log.d("TEST", "Portrait"); break; } } private void includeFragments() { ContainerFragment fragmentCont = new ContainerFragment(); FragmentTransaction trans = getSupportFragmentManager().beginTransaction(); trans.replace(R.id.container, fragmentCont); trans.commit(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.navigation_drawer_main, menu); return true; } } In der LogCat bekomme ich jetzt angezeigt, in welchem Modus ich mich befinde. Allerdings bekomme ich den Drawer nicht reingewischt
  7. } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); int orientation = newConfig.orientation; switch (orientation) { case Configuration.ORIENTATION_LANDSCAPE: myOrientation = 1; break; case Configuration.ORIENTATION_PORTRAIT: myOrientation = 2; break; } } Hier sollte ja eigentlich eine neue Wertzuweisung erfolgen, sodass ich in der IF-Abfrage "myOrientation" überprüfen kann. Ich habe es jetzt so abgeändert, und es funktioniert soweit, dass ich in der Log ausgegeben bekomme, dass ich im Portrait-Modus bin. Allerdings habe ich es noch nicht geschafft, wie ich nun das linke Fragment als ListView einfliegen lassen kann? @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); orientation = newConfig.orientation; switch (orientation) { case Configuration.ORIENTATION_LANDSCAPE: FragmentA fragmentleft = new FragmentA(); FragmentB fragmentright = new FragmentB(); FragmentTransaction transaction1 = getSupportFragmentManager() .beginTransaction(); FragmentTransaction transaction2 = getSupportFragmentManager() .beginTransaction(); transaction1.replace(R.id.framelayout_left, fragmentleft); transaction2.replace(R.id.framelayout_right, fragmentright); transaction1.commit(); transaction2.commit(); break; case Configuration.ORIENTATION_PORTRAIT: createNavigationDrawer(); Log.d("TEST", "Portrait"); break; } } So lange ich das DrawerLayout als invisible habe, funktioniert es. Sobald ich es aber sichtbar mache, kommt der Fehler, dass ich ein FrameLayout nicht zu einer ListView casten kann. Wie kann ich das jetzt realisieren? Mein FragmentA ist eine ListView, doch wie mach ich jetzt, dass die ListView, welche das DrawerLayout enthält dieses FragmentA als Inhalt benutzt? Danke schonmal
  8. Ich habe myOrientation jetzt den Wert 1 gegeben, aber es ändert ja nichts daran, dass der Wert in switch-case Anweisung nicht überschrieben wird
  9. Sobald ich in den Portrait-Modus wechsle, bricht die App ab. Sorry, habe jetzt gerade erst gesehen, dass es diese gibt. Ich werde sie beim nächsten Mal benutzen @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); int orientation = newConfig.orientation; switch (orientation) { case Configuration.ORIENTATION_LANDSCAPE: myOrientation = 1; break; case Configuration.ORIENTATION_PORTRAIT: myOrientation = 2; break; } } myOrientation ist an der Stelle hier schon leer, laut Debugger
  10. Hallo, ich möchte gerne einen NavigationDrawer einblenden, der aber nur beim Wechsel in den Portrait Modus erscheinen soll. Im Landscape Modus möchte ich Fragment A und Fragment B nebeneinander darstellen, im Portrait Modus dann Fragment A als NavigationDrawer einblenden. Leider funktioniert es nicht wirklich. Kann mir vielleicht jemand weiterhelfen? Hier ist mein Code : MainActivity: package com.example.navigationdrawerdemoapp; import android.os.Bundle; import android.app.Activity; import android.content.res.Configuration; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTransaction; import android.support.v4.widget.DrawerLayout; import android.view.Menu; import android.view.View; import android.widget.ListView; public class NavigationDrawerMainActivity extends FragmentActivity { private DrawerLayout myDrawerLayout; private ListView myDrawerList; int myOrientation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_navigation_drawer_main); if (myOrientation == 1) { FragmentA fragmentleft = new FragmentA(); FragmentB fragmentright = new FragmentB(); FragmentTransaction transaction1 = getSupportFragmentManager() .beginTransaction(); FragmentTransaction transaction2 = getSupportFragmentManager() .beginTransaction(); transaction1.replace(R.id.framelayout_left, fragmentleft); transaction2.replace(R.id.framelayout_right, fragmentright); transaction1.commit(); transaction2.commit(); } else if (myOrientation == 2) { createNavigationDrawer(); } } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); int orientation = newConfig.orientation; switch (orientation) { case Configuration.ORIENTATION_LANDSCAPE: myOrientation = 1; break; case Configuration.ORIENTATION_PORTRAIT: myOrientation = 2; break; } } private void createNavigationDrawer() { myDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); myDrawerList = (ListView) findViewById(R.id.framelayout_left_drawer); // myDrawerLayout.setVisibility(View.VISIBLE); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.navigation_drawer_main, menu); return true; } } Portrait XML <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <FrameLayout android:id="@+id/framelayout_right" android:layout_width="match_parent" android:layout_height="match_parent" /> <ListView android:id="@+id/framelayout_left_drawer" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="#111" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" /> </android.support.v4.widget.DrawerLayout> Landscape XML <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".NavigationDrawerMainActivity" > <FrameLayout android:id="@+id/framelayout_left" android:layout_width="500dp" android:layout_height="fill_parent" android:layout_alignParentLeft="true"/> <FrameLayout android:id="@+id/framelayout_right" android:layout_width="300dp" android:layout_height="fill_parent" android:layout_alignParentRight="true" /> </RelativeLayout> Vielen Dank schon einmal im Voraus
  11. Danke Darf ich fragen was du gerade machst? Habe gelesen du studierst an der FU Hagen? Welcher Studiengang ist das? Habe vor neben der Ausbildung die Fachhochschulreife zu machen und dann vielleicht auch in Teilzeit zu studieren. Bin mir aber noch nicht sicher. Kannst du die FU Hagen empfehlen?
  12. Hi, Habe nun meinen Ausbildungsvertrag unterschrieben. Vielen Dank nochmal für eure Hilfe
  13. b0mmell

    SAP Produkte

    Ok Vielen Dank Ja, auf diese Fragen habe ich mich auch schon vorbereitet bzw. mir Notizen gemacht

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...