Lollipop's Recents container

Overview

MaterialRecents

Easy to use adapter container. For details check the sample code. Uses CardView, works on all Android versions back to Froyo.

I was asked to extract some of the features of the Carbon library to separate projects so it's possible to include just one feature in one's app. This project is one of them. For all features, demos, changelog and Maven support check out Carbon: https://github.com/ZieIony/Carbon

This project is not really maintained. It could be written better - reuse views, have some kind of configuration and handle touches properly. Unfortunatelly I don't have time to add any of these features. If you wish, you may reuse any parts of this project, propose pull requests to this repo or base your own solutions on my code. I'm leaving issues section open for your convenience.

gif

Importing

To include in your project, check: https://jitpack.io/#ZieIony/MaterialRecents

repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    implementation 'com.github.ZieIony:MaterialRecents:master-SNAPSHOT'
}
Usage
RecentsList recents = (RecentsList) findViewById(R.id.recents);
recents.setAdapter(new RecentsAdapter() {
    @Override
    public String getTitle(int position) {
        return "Item "+position;
    }

    @Override
    public View getView(int position) {
        ImageView iv  =new ImageView(RecentsActivity.this);
        iv.setImageResource(R.drawable.mazda);
        iv.setBackgroundColor(0xffffffff);
        return iv;
    }

    @Override
    public Drawable getIcon(int position) {
        return getResources().getDrawable(R.mipmap.ic_launcher);
    }

    @Override
    public int getHeaderColor(int position) {
        return colors[random.nextInt(colors.length)];
    }

    @Override
    public int getCount() {
        return 10;
    }
}
Comments
  • set On item click listener

    set On item click listener

    Hi, thanks for your widget. I set OnClickListener but doesn't work. in RecentsList.java: card.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // do something here } } });

    bug 
    opened by mneckoee 2
  • Issue while compiling

    Issue while compiling

    Warning:Dependency com.github.ZieIony:MaterialRecents:d2aec46f48 on project app resolves to an APK archive which is not supported as a compilation dependency. File: C:\Users~.gradle\caches\modules-2\files-2.1\com.github.ZieIony\MaterialRecents\d2aec46f48\494f96d345471f38b6f3f4c1c42347a2b42f8303\MaterialRecents-d2aec46f48.apk

    opened by meMuhammadkamal 1
  • scrolling view

    scrolling view

    i want to show last item first and then the scrolling starts downwards any help where do i do the changes in your code for eg: i want to start from item 9 and scroll down for rest of the cards till item 0

    enhancement 
    opened by KaustubhSatam 1
  • RecentList is not showing in some small screens like if it is in fragment?

    RecentList is not showing in some small screens like if it is in fragment?

    I have the fragment with view pager in the top but at the bottom, I want to display that recentList view but it is showing only empty cards without any data, if I set to the full view then it is displaying the card with data. I have given the height is match parent, but if I change the height then also it is not displaying.

    bug 
    opened by Hanumantha-Rao 0
  • Horizontal Direction

    Horizontal Direction

    I want to change to direction from vertical to Horizontal cards, how to do this? It will be much appreciated if you help me finding that specific code.

    enhancement 
    opened by naveedahmad99 2
  • Unable to see views inside the fragment, but can see only in activity

    Unable to see views inside the fragment, but can see only in activity

    When we use the RecentList inside an activity, it works fine. But when we use it inside a fragment it is not visible. can you help me in resolving this problem.

    bug 
    opened by amrut8winjit 3
Owner
An engineer, a guitarist and a platypus with love for UI/UX
null
Arc Layout is a view group with which you can add a arc-shaped container in your layout.

ArcLayout Arc Layout is a view group with which you can add a arc-shaped container in your layout. Two main variables are the direction and the curvat

Ali Rezaiyan 32 Aug 17, 2022
A small android library for tagging views inside a ScrollView as "sticky" making them stick to the top of the scroll container until a new sticky view comes and takes it's place

StickyScrollViewItems StickyScrollViewItems is a ScrollView subclass that allowed you to mark items inside the ScrollView as sticky. The items marked

Emil Sjölander 1k Jan 7, 2023
ExpandableSelector is an Android library created to show a list of Button/ImageButton widgets inside a animated container which can be collapsed or expanded.

ExpandableSelector ExpandableSelector is an Android library created to show a list of Button/ImageButton widgets inside a animated container which can

Karumi 699 Nov 19, 2022
Predictable state container for JavaScript apps

Redux is a predictable state container for JavaScript apps. (Not to be confused with a WordPress framework – Redux Framework) It helps you write appli

Redux 59.1k Jan 3, 2023
Loading layout is a container view that manages easy switching between loading, completed and other states of your screen with a single line.

Loading layout is a container view that manages easy switching between loading, completed and other states of your screen with a single line.

ValarTech 16 Jul 5, 2022
Android Emulator Container Scripts

This is a set of minimal scripts to run the emulator in a container for various systems such as Docker, for external consumption. The scripts are compatible with both Python version 2 and 3.

Google 1.5k Dec 29, 2022
Lightweight service for creating standalone mock, written in pure Kotlin with Netty container.

MockService The lightweight service for creating a standalone mock, written in pure Kotlin with Netty container. The service allows getting config fil

null 2 Oct 28, 2021
Aagent-new-service-parent - A Springboot Rest Webservice Project that can be deployed to a Docker container

Webservice in a Docker Container A Springboot Rest Webservice Project that can b

ReeceRiley-aa 0 Jan 4, 2022
A high-performance Android system parasitic container.

Mizuki A high-performance Android system parasitic container. This is a project idea that will be realized in a few years time. License GPL-3.0 Copyri

Fankesyooni 1 Jan 10, 2022
ArchGuard is a architecture governance tool which can analysis architecture in container, component, code level, create architecure fitness functions, and anaysis system dependencies..

ArchGuard backend ArchGuard is a architecture governance tool which can analysis architecture in container, component, code level, database, create ar

ArchGuard 446 Dec 20, 2022