Android Top and Bottom menu [closed] - android

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am new in Android and i don't have much programming knowledge. I want to create top and bottom menus for my android app. i have attached a sample image. Please someone help me

There are two possibilities of how you can achieve something like that:
1) Use a split ActionBar (more information on the ActionBar)
2) You can define it yourself inside an XML-layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="#+id/top_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
</LinearLayout>
<!-- Your page-content can go here -->
<LinearLayout
android:id="#+id/bottom_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" >
</LinearLayout>
</RelativeLayout>

Design two custom layout xml one for top menu bar and one for bottom menu bar. And include these xml file in your main xml. Then call the button in custom xml same as calling from main xml in the java file.

Related

Android: Any Ideas on how to make a Hearthstone/Magicka type of card? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Details:
I was wondering how to create an object in android that has multiple layers of graphical elements. A good example would be a Magicka or Hearthstone card. They have 3 elements: the background of the card, the image of the creature, text describing something + stats.
The idea behind this is to have fewer images that can be put together to create a great amount of cards. I should mention that in my case the background card and the creature are vectors (SVG).
How do you put all of these elements together in one card-thing that can later be displayed&animated?
You can use proper layout.
Most reasonable to me is using RelativeLayout.
You can put all views:
background (can be a separate view or background view param)
image (ImageView)
text (TextView)
For example:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="160dp"
android:layout_height="240dp"
android:background="#color/aaa">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:src="#drawable/cat_filmy_main" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:text="Movie Killer" />
</RelativeLayout>
And the effect is:
Also, consider creating your own view. How to do that can be found here:
https://code.tutsplus.com/tutorials/android-sdk-creating-custom-views--mobile-14548

Android EditText just like Google's Allo messaging app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to design edit-text just like Allo messaging app in which on scrolling down the list of messages, message-view is still visible behind that edit text view as shown in image.
How to design this type of edit text view?
Aligning the EditText at the bottom in front of the list should be pretty easy. I would recommend the following layout:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ScrollView>
<EditText
android:layout_alignParentBottom="true"
android:layout_margin="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
You will still have to add elements to your ScrollView or replace it with a ListView, but this should do the trick.
As a side note, elements in the layout file that are added last will be 'in front' of the other views. Because the last element in our layout is the EditText, it will always hover on top of the ScrollView.
Hope this helps!

What should I do in this case? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have antwo fragments like this:
What I want is when I press the "MapView" button, the whole screen will be like this:
so what should I do in this case to have the best UX? should I turn two fragments off and add a new one? Pleases give me some ideas! Thank you!
It's better to convert the whole stuff into 4 fragments.
Fragment 1: Search Bar
Fragment 2: Two Buttons
Fragment 3: Bottom list
Fragment 4: The map
So in this case you can listen to click on each button and replace the corresponding container having fragment 3 with fragment 4. If your design requires to hide fragment 1, it could also be done in this case.
I recommend to use a PagerTitleStrip layout. Just replace the content below the title strip by a fragment transaction. Feel free to ask, if you need further information (how to set it up).
A good starting point are the docs, the guidelines and maybe this tutorial.
Btw: one of my apps does a similar job, have a look: Libre Drive
You need to have a parent layout which will have two buttons at top. MapView and List View. Then Display desired Fragment with click on button through java code
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical" >
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="MapView" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="ListView" />
<fragment
android:name="com.example.app.myFragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:layout="#layout/my_fragment"
/>
</LinearLayout>

how to make one screen working for mutlple tasks in android [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to make an android app which contains four buttons on top of screen and when pressing each button i need different screens below those four buttons.please tell how to make it.
You should Use Fragment...
You can build an activity that contains 1 fragment for buttons, and one view for replace it with a fragment
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment
class:"com.example.ButtonFragment"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
tools:layout="#layout/button_fragment" />
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:id="#+id/LayoutForReplace"/>
Then you can set action listener of buttons like this:
getActivity().getFragmentManager().beginTransaction().replace(r.id.LayoutForRepalce, new SomeFragment()).commit();

Join the two EditBox into 1 EditBox in Android [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am new in android.
I want to join two EditBox into 1 EditBox.
Anyone can help me here.
Thanks in Advance.
Give background to a linear layout with vertical orientation and add two transparent text box in it.
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/background_of_big_edittext"
android:orientation="vertical" >
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/color_of_your_divider" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent" />
</LinearLayout>
I dont know if you are talking about the UI. But you can take the texts from the edit text by get text method. Why cant you join both the texts to a single string and use the combined string in program?

Categories

Resources