Giter VIP home page Giter VIP logo

socialsearcher's Introduction

Android App - Social Search


Introduction

A twitter search client. User can search for tweets matching their entered search criteria. This app has the following features.

  • Prominent text content of tweets
  • Support paging of search results.
  • Provide search text suggestions based on user's search history
  • Links in the content text are made prominent using different text color.
  • Links are clickable, and a WebActivity is provided to handle the url.
  • The WebActivity have a mechanism to handle no internet situation and support pull to refresh.
  • A LaunchActivity that has a flip animation using my own library-FlipView

And for bonus points, this App provides three more additional search functionality.-- Video, Near and Until.

  • Video is to search for tweets that have video links.
  • Near is to search for tweets that have been tweeted near user's position
  • Unitl is to search for tweets published until a certain date.
  • Provides a user interface to easliy exploit these functions.

For code structure:

  • The App is based on MVP model.
  • Using Daggar2 and Rx to achieve Dependency Injection
  • Using Fragments and ViewPager so this App is Expandable

Features

Search for keywords and load more search result by scrolling down

Gif example


Launch animation using my own library FlipView

Gif example


Search for video

Gif example


Search for Near tweets

Gif example


Search for tweets unitl a certain time

Gif example


Click url link and launch WebActivity

Gif example


Search suggestions based on search history

Gif example


Ask for ACCESS_FINE_LOCATION after API 23. And ask for enable GPS for location function used in Search Near feature

Gif example


Show empty view when the search result is empty

Gif example


Show no internet view when there is no internet connection

Gif example


A build-in no internet view in WebActivity(Otherwise only shows 404, which is hideous)

Gif example


Download

app-release.apk


Compile instruction

Clone the project and sync and build in Android Studio. The Key and Token for Twitter are in gradle.properties which I shouldn't put them there publicly. But for code review and a quick build of the project, I think it's all right to public it for now.


Reference

When working on this project, I refered to some code from project SearchTwitter for saving time.
I largely reconstructed the code and added more features.


Others

Stuff I learn during working on the project

  • When I was working on the project, I find a bug that the fragments get a null context when its wrapper ViewPager is set to Visibility.NONE. So I looked into it. The flow of ViewPage populate fragments is as follows:
    ViewPager : populate() ->
    PagerAdapter : instantiateItem() ->
    FragmentPagerAapter : instantiateItem() ->
    FragmentTransaction : attach() This is where Fragment be attached

So the main problem is that populate is not properly called.

  • In normal condition, ie, the visibility is VISIBLE or INVISIBLE. The populate() is called in setOffScreenPageLimit() and onMeasure();
  • But when the visibility is set to GONE. the populate will not be called in onMeasure(), so the Fragments are not attached to Activity. So that there Context will be null.

socialsearcher's People

Contributors

fredliao123 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.