Android Studio "Resource" Window - android

I have started Android development and I need to access the 'resource' window. I have searched around and have not found an answer. What I am doing is I am trying to change the background color of my app using the 'color.xml' file I have created. The problem is, I cannot find the 'background_color' resource in the 'RelativeLayout' panel in the 'Design' view in Android Studio. Does anyone know where or how to open this window?!
Sorry for my noobish-ness,
Ben

To pull up the "resources" window, you have to:
Open the activity in "Design" mode.
Select the "RelativeLayout"
Go to "Properties" pane and find whatever property you need.
Once selected, click the "..." button.
A window appears with a list of all properties.

If you want to set a background color of a relativeLayout, you can use the background resource. This can be any of the predefined colors, or a special layout file you made that specifies the shape of the layout, curved edges, etc.

Related

Remove Android app border with FireMonkey

I create an Android app with FireMonkey (10.2.2), but I don't understand why I have a top and right white border. I never added that to my app.
I started to create an example app, just a black form with a black TRectangle without sides.
I don't have to code anything, just design. When I compile for Windows, it's OK. I have this border only on Android.
I get this result:
You can download the example project here : Click Here to Download
I was having the exact same problem when adding a TStyleBook, but I found a workaround. The steps are the following:
Click on the form (I've done it in the Master view, of course)
Go to the Properties tab, then open Fill > Color
Choose your desired color, you can copy it from the style you imported for the TStyleBook (In my case it was: #FF2B3840 from the backgroundstyle setting in the style)
Within Fill also change the Kind to the value Solid
Basically, this workaround is about manually overriding the inherited style from TStyleBook. I know this is not ideal because it's a hardcoded value you'll have to keep track of if you ever change styles at runtime in your app.
Source link #1: Click here.
Source link #2: Click here.
Source link #3: Click here.

Cannot find ConstraintLayout's properties

I am new in android. I decided to use ConstraintLayout. But i cannot find out how to turn on a view's properties. There isn't any tab in the editor.
I use Android studio 3.0.1.
There isn't any tab in the editor.
there is design tab left to text in xml file
Move to Design tab below and in that drag any textview/widget to the layout
Now, just click on that textview/widget, it will show you all properties than you can change from there no need to change in xml file manually it will reflect there too.
It's available in SplitMode
I am using Android Studio-4. I did not find it the attribute option on Design Mode.
Click on Split and then attribute tab will appear
Final Step

Buttons not visible on the application. What's wrong?

I created an empty activity for 'My Testing App' and it looks like the following in the preview section:
But when I generated a build apk and used the same in my cell phone the result was like the following:
I can only view the exit button on the very top left but the two other buttons, that should be above it are missing.
I tried to rearrange the icons on the screen as well. I made them to go to the bottom, to the right most, but I see no change when the apk is reinstalled.
How do I make them visible on the hardware?
Here is the snap of the code for this activity:
To quickly add constraints to your layout just click on the Infer Constraints button in the Layout Editor toolbar. Learn more about the feature here: https://developer.android.com/training/constraint-layout/index.html#use-autoconnect-and-infer-constraints
Right Click on you Layout and select "Convert View" Option.
then select "LinearLayout" Option.
it will show all three buttons in the output.
You have to learn about ConstrainLayout in Android
View in ConstrainLayout is not only drag and drop. You should link the constrain line in each view to reference with somewhere on the screen.
Any XML attributes prefixed with tools are removed when the app is compiled and are only rendered by Android Studio layout editor.
You need to properly set constraints in your ConstraintLayout, not use absolute positioning.
Or you may instead use RelativeLayout, LinearLayout, etc.
https://developer.android.com/training/constraint-layout/index.html
Start by reading this. Most of what you need is answered here. The problem is that your views are not properly constrained (basically they aren't linked to anything so when you run your app it doesn't know where to place them and just defaults to the upper left).

what is the color used in seekbar

I am trying to find the color code for the bright light blue color used by the Android framework in some of their widgets. I understand that the framework uses 9 patch images to draw these widgets, so the color code would theoretically not be stored in the framework code.
But is there a way to find what was the color code used in the SeekBar or the ToggleButton(the small blue line when Checked)?
I generally use #33B5E5 for the color.
Take a screenshot of the image and upload it to this site and click the color you want to know about.
http://html-color-codes.info/colors-from-image/
In Android-Studio you can do it in the Program itself too. To do that, follow this steps:
Put the Item in your view that you wish to know the color from or have a picture or screenshot ready and open on the PC
Select an item (Button, View, etc) in the "Component-Tree" on right side and go to the "Color-Property" or the prop "Backgroud" of the selected item (one has to be in Design-Mode to see the Component-Tree).
Then click the "..." behind the Property-Edittextfield and a menu opens up where you can choose a color, by either go to the System-Tab and choose a predefined Android-System Color (you see all the different greens here for example). After select a color you see the value of it in the value window below.
You can also go to the Color-Tab and click the little color-selector item, then hover it over the Layout-item that you draged to the view in step 1 and try to hover the spot where the needed color is. You can have also a screenshot open, or the android emulator or something. The color-picker lets you hover also over outside program views, not only insde Androidstudio.
Voila, there you have all system colors.

Accessing Android Studio properties window?

I have recently started using Android Studio and cannot work out how to access the properties window.
The following screenshot was taken from Google and shows exactly what I'm trying to access denoted by the red rectangle around the properties window.
Can anyone please tell me how I can access this?
Switch to design view. Click "Design" tab at bottom-left work area.
In the new Android Studio Version 3.1.2, the name of the Propierties Windows is "Attributes".
Look at this picture:
Attributes basic view
And, if you want to see the complete attributes, simply click on "View all attributes":
Attributes full view
How to restore windows?:
restore windows
I had the same issue than found that the properties window was always there but I had to drag it out with my mouse. Just go to the far right vertical bar in Design mode then drag to the right when your mouse turns into horizontal arrows pointing away from each other. Hope this helps!
You can just click on the design tab on your screen (at the left bottom corner below your code text window) and just click on anything whose property you want to change
make sure you are in the '.xml' file
I accidentally deleted the properties side bar and Window-->restore deafult layout helped.
Follow the doc.
Instead of editing your view properties in XML, you can do so from the Properties window (on the right side of the Layout Editor). This window is available only when the design editor is open, so be sure you've selected the Design tab at the bottom of the window.
When you select a view, the Properties window shows the following, as indicated in figure 5:
View inspector with controls for width/height style, margins, and bias (available only for views in a ConstraintLayout). For more information, see Build a Responsive UI with ConstraintLayout.
This happens all the time, to my opinion Android team should see as an improvement opportunity, here is the solution, click on the settings (gear symbol) on the right make sure that the attached side is set to None. also -See screen shot-> 1,
You have three ways to see the fields, design mode, split mode and code mode. THE ONLY ONE THAT shows the Attribute bar is on the SPLIT MODE, click on the Attribute see screenshot->
if that does not work, you can go to Windows -> Restore default Layout
if that still does not work you can do File -> Manage IDE Settings -> Restore Default Settings.
if that still does not work you can go in file explorer and delete the .android studio folder in C\users[your user].Androidstudio#.#
Hope this helps someone out there...

Categories

Resources