Make a calculator like this using Android Studio

Design Part
- Same Design, same UI
- Keep Correct Alignment
- You can see the app uses same color in multiple places ( Black for letters , blue for operators, white for number button background, light gray for operator button background )
So you should store these color in res/values/colors.xml with suitable name ( operator, operator_bg & etc... ) . and use this color names instead of color codes in main_activity.xml
- For data display panel, set width='match_parent' and set textalign to right
- Listen, there is no EditText used.
There is a text view which stores the numbers,
there is a text view to show numbers, and the rest are numbers
the backspace icon is an image you can find similar images from google.
or you can download it from https://material.io/icons/#ic_backspace - Change app icon
- Bring the shadow under Display Panel
- Add any simple animations to buttons when they clicked
Algorithm :
- 1.When any button is pressed add corresponding number / operator to TextView1
eg: 256+274+(22)
2. Split each of them as brackets as delemeter
3. Check if there is open brackets , and if so check if there is closing brackets also.
4. Convert numbers into float or integer
5. Do mathematical operations and get the result
6. Show the result - BODMAS rule should be satisfied.
- If there is any error like syntax error or logical error ( zero division error ) in user input , don't display result. Just toast the error
- Result should have decimal point if it is float, It is an integer, it should't have a decimal point. ( eg: - don't show 29.00 just show 29
- Should't have an crashes.
- Use Array to store datas ( numbers and operators )
Try to solve problems using google, if you can't ask here.
Date : Let us decide
.
All of you create a github account ( github.com ), and follow me https://github.com/shameelsadaka .
We will upload the source of our final product to github.
Color Codes :
We will upload the source of our final product to github.
Color Codes :
- Display Panel Background : #FAFAFA
- Display Operators Text Color Blue : #1083A0
- Result Gray : #ADADAD
- Number Button Background: #FAFAFA
- Operators Button Background Gray : #F2F4F3
- Operators Button Text Color Blue: #0899D2
- Equal Button Green : #4AAE4E
Comments
Post a Comment