Android Practical 108 | Seekbar to define color | Part 1 | DEFINE COLORUSING SEEKBAR | USING SEEKBAR

Опубликовано: 23 Март 2026
на канале: Chirag Rachchh
64
5

In this video, I have demonstrated an application where seek bars are used to define a color by setting components of RED, GREEN and BLUE color.
Definition:
Develop an ANDROID application that demonstrates the following functionalities:
On HOME activity, an image view and a button labeled as “SET COLOR” must appear.

The image view must be at the centre of the screen and the button must be at the bottom of the screen
[In case of landscape layout, the image view must appear at the left end of the screen and
the button must be at the right end of the screen.]

The entire image view initially should display BLACK color .

On click of the “SET COLOUR” button, a custom dialog must appear with three seek bars each for the
colour RED, GREEN and BLUE respectively .

On the change of the seek bar the respective colour must change in the image view.

When the user clicks some where outside the dialog box, the dialog must disappear .

When the dialog re-appears on click of button, it should display the seek bars with the last selected position.

The HOME activity should also have a menu with the options labeled as “SET as DEFAULT” and “RESET”.

On selecting the “SET as DEFAULT” option, the currently selected colour should be saved for next execution
cycle of the application. i.e when the application is started next time, the colour should appear as in the
image view rather then the BLACK colour.

Also once the colour is set as default, a custom toast must appear at the bottom of the screen with the
selected colour on left and the colour code on the right

On selecting the “RESET” option, the BLACK colour should be considered as the default colour.
Also once the shape selection is reset, a custom toast must appear with the name of the colour right
aligned in the toast. The toast must appear at top of the screen.