Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google photos application timeline feature using the year of images when they created

I want to implement the google photos application timeline feature in the recycler view in which we can scroll through the years of images when they are created as shown in below image.

google photos year timeline feature

Can anyone help in this or implemented something like this.

like image 473
Akash Bisariya Avatar asked Jun 06 '18 18:06

Akash Bisariya


People also ask

What is Google timeline photos?

Google Photos has added a new Maps timeline feature that shows the pictures of your trips on the routes that you've taken. The feature is live in Photos version 5.23.

How do I view my Google Photos by year?

Search Google Photos by Date When you search by date, you can type a specific time, such as "March 3, 2021." You can also enter an approximate time like "March 2021," or even just a general year to see all the photos taken during that time frame. You can also search for words like evening, morning, summer, and winter.

How can you tell when a picture was taken on Google?

To see the date & time, tap the photo & slide up. Below the picture you will find all the information including the date & time.


1 Answers

I have solved this problem by simply adding a new Linear-layout on top of the recyclerview with a child textview in the layout and then by calculating the height ratio(as per the count of images per year) with respect to the total height available.Also considering the minimum height of textview to 100 if the ratio is too small.

private float getEffectiveHeight(float totalHeight, float count, float totalCount) {
    if (count * (totalHeight / totalCount) < 100)
        return 100;
    else
        return count * (totalHeight / totalCount);
}

enter image description here

like image 71
Akash Bisariya Avatar answered Oct 01 '22 21:10

Akash Bisariya