• Stars
    star
    381
  • Rank 112,502 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ…ΏοΈ Easily add and customise "New Post" popup button with the feeds (RecyclerView) of your app.

Android Arsenal Open Source Love License

PopupBubble

Easily Add "New Post" popup button with the feeds (recyclerview) of your app.

Min SDK

Minimum sdk is 14 and support is limited to recyclerview for now.

Add With Gradle Dependency

compile 'com.webianks.library:popup-bubble:1.0.5'

Maven:

<dependency>
  <groupId>com.webianks.library</groupId>
  <artifactId>popup-bubble</artifactId>
  <version>1.0.5</version>
  <type>pom</type>
</dependency>

Add PopupBubble to layout

<com.webianks.library.PopupBubble
  android:id="@+id/popup_bubble"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
/>

Positioning of this view can be done according to the need. By default it should be placed in top center. Also it should be placed below recyclerview in layout so that it shows on top of recyclerview.

Example positioning

If its inside RelativeLayout then

<com.webianks.library.PopupBubble
  android:layout_margin="16dp"
  android:id="@+id/popup_bubble"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_centerHorizontal="true"
/>

Customization Through XML

<!--Change background Color-->
    app:pb_backgroundColor="?attr/colorPrimary"
<!--Change text -->
    app:pb_text="New Stories"
<!--Change text color-->
    app:pb_textColor="#ffffff"
<!--Show/Hide Icon inside the button. By default its true.-->
    app:pb_showIcon="false"
<!--Change icon color-->
    app:pb_iconColor="#ffffff"
<!--Set Different Icons-->
    app:pb_icon="@drawable/ic_new.png"
<!--Set different fonts-->
    app:pb_font="iran_sans_mobile.ttf"
        

Example : Full Customization

<com.webianks.library.PopupBubble
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_margin="16dp"
  android:id="@+id/popup_bubble"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_centerHorizontal="true"
  app:pb_backgroundColor="?attr/colorPrimary"
  app:pb_iconColor="#ffffff"
  app:pb_text="New Stories"
  app:pb_textColor="#ffffff"
  app:pb_icon="@drawable/ic_keyboard_arrow_up_white_18dp"
  app:pb_font="iran_sans_mobile.ttf"
/>

#Access the bubble from Java

PopupBubble popupBubble = (PopupBubble) findViewById(R.id.popup_bubble);

Add listener if you want to know when the bubble is clicked

popupBubble.setPopupBubbleListener(new PopupBubble.PopupBubbleClickListener() {
            @Override
            public void bubbleClicked(Context context) {
  
                //popup_bubble is clicked  
            }
        });

Attach with your RecyclerView

 //necessary to add
popupBubble.setRecyclerView(recyclerView);

#Helper Methods Hide/Show PopupBubble according to your need

popupBubble.hide();
popupBubble.show();

Control Animations Set false if you dont want any animations. Default value is true.

popupBubble.withAnimation(false);

Update text dynamically Call this method before the activate method to set the new text.

popupBubble.updateText("10 new stories");

Update icon dynamically Call this method before the activate method to set the new Icon.

popupBubble.updateIcon(R.drawable.new_icon);

Update typeface of text dynamically Call this method before the activate method to set the new Typeface.

popupBubble.updateTypeFace(myCustomTypeface);

Most Important

Now download/fetch new content in background and then notify your recyclerview adapter about range of items added and finally activate the PopupBubble to make it appear with animation (if not set false).

//Own logic for fetching new content
 .....      
adapter.notifyItemRangeInserted(0,size_of_new_items_added); // size_of_new_items_added = 10 if 10 new items are added.
popupBubble.activate(); 
    

License

PopupBubble library for Android
Copyright (c) 2016 Ramankit Singh (http://github.com/webianks).

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

ScrollChoice

βœ”οΈ Scrollable view which can be used to give different choices to user with nice ui.
Java
197
star
2

msgs

πŸ“₯ Messaging app utilising some of the sms APIs.
Kotlin
163
star
3

BluetoothChat

β˜‰β€ΏβŠ™ Simple bluetooth chat app.
Kotlin
120
star
4

EasyFeedback

✏️ Easily gather feedback from any android application. Get detailed information on the email.
Java
103
star
5

EasyPortfolio

πŸ’» Easily add Portfolio Screen in your android app.
Java
28
star
6

PlayStoreParallelDownload

πŸŒ€ Demo logic to download/update apps in parallel inside recyclerview like AppStore.
Java
26
star
7

Crimson

πŸ‘“ An android application that can prove to be the ultimate care taker of your eyes. [Built during hackDTU event.]
Java
24
star
8

Expensive

Simple Expense Manager App using MVP.
Kotlin
24
star
9

BreathingProgressDemo

πŸ”΅ Nice little breathing progress which can be used in replacement with the default ProgressBar in Android.
Java
22
star
10

webianks_resume

πŸ“„ Clone of MaterialResume with customizations for my resume.
HTML
7
star
11

scout

πŸ”° Scout helps to perform email search flawlessly on the basis of extracting various email search parameters from plain english query.
Java
4
star
12

CybonitoApp

Source code of official android app of fest "Cybonito".
Java
3
star
13

INCHECK-InternetCheck

πŸ“‘ This project contains very simple but usefull feature to check if the device has the Internet Access or not.
Java
3
star
14

BestKick

Pseudo Mobile application which lists the best Kickstarter.com projects.
Java
3
star
15

flutter_resume

My portfolio website built with Flutter Web
Dart
2
star
16

adidas-concept

Adidas Concept App made with Flutter.
Dart
2
star
17

Creddit

Basic credit card maintenance demonstration app.
Kotlin
2
star
18

EdforaStudio

Pseudo Android application that lists and plays best coke studio songs. [Edfora Hiring Challenge]
Java
2
star
19

EduCorp

A simplified way to connect parents and tutors! [Rang De Android Hiring Challenge]
Java
2
star
20

travy-bot

Your travel helper chat bot.
JavaScript
1
star
21

doggo

Kotlin
1
star
22

MallOfDeals

Mindtree Digital Hackathon 2015 project.
Java
1
star
23

NasaPicturesApp

Kotlin
1
star