Is it possible to create a layout like this in Android..? [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 4 years ago.
Improve this question
I want to design a XML resource layout like traditional blogs as shown in the below image. It should contain an image on the right side and rest of the area (combining left side area of the image and whole area below the image) should be filled with text.
Any ideas?

You are looking for FlowTextView
Here is an snippet
<uk.co.deanwild.flowtextview.FlowTextView
android:id="#+id/ftv"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="10dip"
android:src="#drawable/android"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="400dip"
android:padding="10dip"
android:src="#drawable/android2"/>
</uk.co.deanwild.flowtextview.FlowTextView>
and in code
FlowTextView flowTextView = (FlowTextView) findViewById(R.id.ftv);
Spanned html = Html.fromHtml("<html>Your html goes here....");
flowTextView.setText(html);
Add jitpack to your your build.gradle at the end of repositories:
repositories {
// ...
maven { url "https://jitpack.io" }
}
Add the dependency:
compile 'com.github.deano2390:FlowTextView:2.0.5'

You'll want to brush up on creating custom Views then.
A single TextView will not be able to do this for you since its workable space is rectangular.
You can create a custom View that will know how to layout variable width per line text as well as draw the image view where you want it.
I recommend starting with what android.widget.TextView does to draw text and modify it to suit your needs.
Or, you can find a custom View that someone else has already written and componentized that you can use.

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

How to create an arc shaped progress bar in Android? [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 5 years ago.
Improve this question
I'm trying to create a progress bar like the following image.
My requirements are:
1. I want to be able to set a progress value to it programmatically.
2. I want to be able to change the colors of the arc - both the background one (grey) and the foreground one (green).
I looked into libraries but found none that do it in this particular shape and style. I am not proficient enough in creating custom drawables to be able to create this by myself. Any help is appreciated!
In addition to the above answer, you can also use CircleProgress which seems to have something that looks exactly like your use case:
Usage:
<com.github.lzyzsd.circleprogress.ArcProgress
android:id="#+id/arc_progress"
android:background="#214193"
android:layout_marginLeft="50dp"
android:layout_width="100dp"
android:layout_height="100dp"
custom:arc_progress="55"
custom:arc_bottom_text="MEMORY"/>
Also, if you check the license on this library (bottom of their README), it seems like it's very favorable to using it however you wish.
You can use SeekArc. It can do everything you need to get that result.
It would look something like this
<com.triggertrap.seekarc.SeekArc
android:id="#+id/seekArc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="30dp"
seekarc:rotation="180"
seekarc:startAngle="30"
seekarc:sweepAngle="300"
seekarc:arcColor="#color/grey"
seekarc:progressColor="#color/green"
seekarc:touchInside="true" />

How to make each cell of listview like card or box? [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 5 years ago.
Improve this question
I want to make a listView where the each cell is separated by some dp's like a card in cardView and also give some shadow. I want something like this how can I get it ?
it is called CardView
CardView is another major element introduced in Material Design. Using CardView you can represent the information in a card manner with a drop shadow (elevation) and corner radius which looks consistent across the platform
compile this library
compile 'com.android.support:cardview-v7:25.3.1'
than add cardview to your layout like this
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="10dp"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
// add all your controls here
</LinearLayout>
</android.support.v7.widget.CardView>
for more information androidhive or here or Android Developers

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!

Add overlays to video on Android [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'm developing an Android application, this application load video file from android gallery that saved on SD Card.
I need to know how can I add overlays to this video
I need to add title and image on this video like brand images
I can not find an example or tutorial describe how to do this operation
Do I have to use decoding to add overlays? , And if yes how can I do that.
Any example about this...
Provided you're playing the video using a VideoView or similar, you can overlay any View (e.g. TextView, ImageView) using a RelativeLayout.
For example, to show a text on the top right corner of the video:
<RelativeLayout
android:id="#+id/playerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<VideoView
android:id="#+id/videoPlayer"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/videoText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="3dp"
android:text="#string/player_text" />
</RelativeLayout>
As #rbarriuso said, ffmpeg4Android is able to meet your requirement. There is also a guide to install both library and demo in both Android Studio and Eclipse. Following, there are also the watermark command which may satisfy you.
Hope it can help

Categories

Resources