Custom Shape in android - android

I would like to make a custom shape like in the image, but i have no idea how to start, could some body help please

i think you have to deal with images.
you can create a seperate xml for the "head box" like this
<linear layout>
<text view background="dark-grey" text = "o nuts"/>
<image view src="blue line" />
<linear layout>
<image view src="donut" />
<linear layout>
<text view text="price" />
<text view text="date" />
</linear layout>
<image view src="box_border_shadow_lines" />
</lienar layout>
</linear layout>
and somethink similar for the articles...
attention this is no valid xml :) just some hints

Documentation is not enough?

The part you shown on the top in image is Action Bar u can start learning how to make an action bar. i have one example of Action Bar.

Which one? the shape on the bottom of the image with the "Redeem" button?

Related

Android layout organization

I have some general question about layouts in my application I ma trying to make. I have attached a screenshot of how this is suppose to look like. There are 2 headers at the top (search bar with back button), another list of properties (Crag, Grade...). Then we have vertical scrollable table layout.
This is little bit of beginner question, but what layouts would I use to create such page, for example something like this (of course this would need to go in more details to handle all information, but as in rough layout?
<Relative layout>
<Frame layout> search bar </Frame layout>
<Frame layout> list of properties (Crag, Grade...) </Frame layout>
<Table layout> vertical scrollable </Table layout>
</Relative layout>
You can do something like below
<LinearLayout orientation=vertical>
<Toolbar> search bar </Toolbar>
<LinearLayout orientation=horizontal> list of properties (Crag, Grade...) </LinearLayout>
<RecyclerView>
</LinearLayout>

Making a View scroll once bottom is reached

Im trying to create a layout with following looks and behaviour.
<Layout>
<Text "Header"/>
<List> "Contains a couple of texts, most likely LinearLayout" </List>
<Button "Confirm"/>
</Layout>
<Text "Information/Hint"/>
Top-Level Layout is centered on the screen
Information-Text is placed right beneath it (Layout is centered without accounting for this text)
Once the list fills to the point where the Information-Text is pushed out of the screen, the List starts scrolling and the Information-Text remains visible at the bottom of the screen. Distance of the top-border of the top-level-layout to the screen-border is the same as the hight of the information-text
The scrolling-behaviour also takes action if the android-system-settings increased display/text-size to the point where said borders are reached
Its the last two points that give me trouble. I've been experimenting with ConstraintLayout and LinearLayout, but every time the scrolling would work the layout wasn't correct anymore (not centered or margins on the texts screwed)
Any ideas how this could be achived without writing a custom Layout?
Do your view hierarchy like this:
<ScrollView>
<LinearLayout>
<Layout>
<Text "Header"/>
<List> "Contains a couple of texts, most likely LinearLayout" </List>
<Button "Confirm"/>
</Layout>
<Text "Information/Hint"/>
</LinearLayout>
</ScrollView>

set the background transparent on android nativescript?

I want to achieve this kinda transparency on my custom view as displayed by alert view for Android application.
Thanks
#Dlucidone I had this solved by using custom overlay from css.
<GridLayout>
<StackLayout>
// All your page content goes here!
</StackLayout>
<StackLayout class="dimmer" visibility="{{showLoading ? 'visible' : 'collapsed'}}"/>
<GridLayout rows="*" visibility="{{showLoading ? 'visible' : 'collapsed'}}">
<ActivityIndicator busy="true" />
</GridLayout>
</GridLayout>
Set the dimmer class to background transparent css, with width and height to 100%
Information how to use visible and collapsed
https://www.tjvantoll.com/2015/06/05/nativescript-showing-and-hiding-elements/
BTW there is a problem with android on setting isUserInteractionEnabled
https://github.com/NativeScript/NativeScript/issues/3215
If you need this to show an activity indicator as an overlay with a dimmed background, you could use this one: https://github.com/nstudio/nativescript-loading-indicator
import {LoadingIndicator} from '#nstudio/nativescript-loading-indicator'
const loader = new LoadingIndicator()
loader.show({dimBackground: true})
loader.hide()

Android keyboard lags/is slow while closing using adjustResize

I have a custom layout as a form field in an activity.
The structure of the layout of the custom layout is as follows:
<Relative Layout A>
<Linear Layout B>
<Relative Layout C>
<Text View>
<Edit Text>
</Relative Layout C Ends>
<Relative Layout D>
<Text View>
<Image View>
</Relative Layout D Ends>
<Relative Layout E>
<Text View>
<Image View>
</Relative Layout E Ends>
</Linear Layout B Ends>
<View for horizontal line>
</Relative Layout A ends>
This is a form field that is added into the when a button is clicked.
When the android keyboard is closed, it is slow to close and causes some lag, resulting in a momentary blank keyboard state like this:
The more custom fields I add into this layout the worse this lag gets.
With 4 such fields it is a good 2 seconds.
I have tried using adjustPan instead of adjustResize in my AndroidManifest. That works but then the accessibility to the rest of my layout elements is compromised.
Does anyone have any ideas what is causing this lag, or how to solve it without compromising any behaviours?
Thanks!
P.S.: In the picture attached, only the edit text is visible and the rest of the fields are hidden.

Android Paralloid and ImageView onClick

I'm currently trying to implement Paralloid by chrisjenx for Android. It uses a FrameLayout that hosts two different layouts that take up the entire screen size. I need to perform an event during an ImageView's onClick(). The ImageView is located in the first layout.
For example:
<Frame Layout>
<Relative Layout>
<ImageView/>
<!-- Need this guys onclick, nothing outputted though. -->
</Relative Layout>
<chris.jenx.paralloid/>
</Frame Layout>
I've even gone as far as making sure Relative Layout and Image View both have clickable="true" and focusable="true". No Luck.
Have you tried setting the Image clickable property to true?
android:clickable="true";

Categories

Resources