Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Improvements in bottom bar layout #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajay-prabhakar
Copy link
Contributor

@ajay-prabhakar ajay-prabhakar commented Apr 2, 2019

Closes #174

What has been done to verify that this 4works as intended?

Tested in Android Studio and my phone(Samsung j8), it looks good as I expected

GIF

UI

Why is this the best possible solution

Made 2 drawable resource files so 2 buttons look different and applied the background to the buttons also. and added the same layout to fill forms and blank forms and main activity also

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

As by updating the UI so it holds good for user experience and so the app looks like beautiful

Before submitting this PR, please make sure you have:

  • run ./gradlew pmd checkstyle lint findbugs and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.

@ajay-prabhakar
Copy link
Contributor Author

@shobhitagarwal1612 @lakshyagupta21 I made the suggestions given by you can you have a look now

@ajay-prabhakar
Copy link
Contributor Author

ajay-prabhakar commented Apr 3, 2019

@lakshyagupta21 as you suggested that background color white is looking odd I tried some of the other colors similar to the primary color of the app but it does not looks good

@shobhitagarwal1612
Copy link
Contributor

The disabled buttons look just like enabled. Please fix

@ajay-prabhakar
Copy link
Contributor Author

The disabled buttons look just like enabled. Please fix

Initially, I made in the color of gray but @lakshyagupta21 suggested me to make it into app primary color so I made like that, can you suggest me color to make it

@shobhitagarwal1612
Copy link
Contributor

The text color should be grayed out similar to the original button's implementation.

@ajay-prabhakar
Copy link
Contributor Author

@shobhitagarwal1612 @lakshyagupta21 I made the changes suggested by you and I updated how it looks like in PR template can you please review it

Copy link
Contributor

@shobhitagarwal1612 shobhitagarwal1612 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The buttons look great now and work as expected. Nice work @Chromicle 👍
Just a small nitpick and this is good to be merged


<item>
<shape>
<solid android:color=" #D3D3D3" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix this spacing and add the color to the colors.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="2">
android:background="#ffffff"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid using raw values wherever possible.
This can be replaced with @android:color/white

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done instead of @android: color/white I used @android: color/colorTabActive as this is initialized before only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chromicle Sometimes variable name or resources name may confuse someone(as in this case colorTabActive is reserved for tabs related activity but if someone in future changes this value then it will reflect here as well) so its better to use @android:color/white

Copy link
Contributor Author

@ajay-prabhakar ajay-prabhakar Apr 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chromicle Sometimes variable name or resources name may confuse someone(as in this case colorTabActive is reserved for tabs related activity but if someone in future changes this value then it will reflect here as well) so it's better to use @android:color/white

I made the changes can you have a look now

@@ -5,4 +5,5 @@
<color name="colorAccent">#00796B</color>
<color name="colorTabInactive">#CFD8DC</color>
<color name="colorTabActive">#FFFFFF</color>
<color name="lightGray">#D3D3D3</color>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give some meaningful name(for e.g. if you're using it for button border then name it buttonBorder)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I named it to colorButtonDisabled

@@ -193,8 +193,12 @@ private void toggleButtonLabel() {
}
if (selectedForms.isEmpty()) {
sendButton.setText(getString(R.string.send_forms));
sendButton.setBackground(getResources().getDrawable(R.drawable.selector_bottom_recive));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

            sendButton.setText(getString(R.string.send_forms));
            sendButton.setBackground(getResources().getDrawable(R.drawable.selector_bottom_recive));
            sendButton.setTextColor(getResources().getColor(R.color.colorPrimary));

It will be good for you to extract those similar code to a function like updateSendButton(String newText, @DrawableRes int newDrawableRes, @ColorRes int newTextColor).

@@ -21,37 +21,66 @@
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center"
android:textSize="22sp"
android:padding="10dp"/>
android:padding="10dp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid hard coding is better, you can replace the padding by @dimen/default_padding_2.5x.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until now we have not used @dimen so made like hardcoded or else I will make into that way only

android:layout_weight="1"
android:gravity="center"
android:paddingStart="10dp"
android:paddingLeft="10dp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using padding End will make your life easier when facing RTL languages.

@@ -11,43 +11,65 @@
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center"
android:textSize="22sp"
android:padding="10dp"/>
android:padding="10dp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as above.

android:gravity="center"
android:padding="10dp">

<Button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toggle_button has so many attrs the same as send_button , consider extract them into style.xml.

@@ -5,4 +5,6 @@
<color name="colorAccent">#00796B</color>
<color name="colorTabInactive">#CFD8DC</color>
<color name="colorTabActive">#FFFFFF</color>
<color name="colorButtonDisabled">#D3D3D3</color>
<color name="white">#FFFFFF</color>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this @Chromicle in some other PR that avoid naming color resources with the actual color names, give some meaningful names to them, In this case we can remove the white color resource as you can directly use it like android:color/white

Copy link
Contributor Author

@ajay-prabhakar ajay-prabhakar Apr 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah! I updated

@ajay-prabhakar ajay-prabhakar changed the title Updated UI the bottom bar layout, so it looks good Improvements in bottom bar layout Jun 5, 2019
@lakshyagupta21
Copy link
Contributor

@Chromicle Can you resolve the conflicts?

@ajay-prabhakar
Copy link
Contributor Author

@lakshyagupta21 @shobhitagarwal1612 I have done the changes and I added the styles instead of adding same to code to everywhere and I did testing twice and it is working perfectly as accepted
can you please review now

@ajay-prabhakar
Copy link
Contributor Author

@lakshyagupta21 @huangyz0918 can you please review this PR as there are a lot of file changes every time new PR merges I have to solve the conflict

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update UI of bottam bar instead of direct buttons
4 participants