- Android StoryView Examples and Libraries
- (a). StoryView
- Step 1: Install it
- Step 2: Create Stories
- Reference
- Full Example – How to Create a StoryView in Kotlin
- Step 1: Install the library
- Step 2: Create layout
- Step 3: Write Kotlin Code
- Download
- Oclemy
- 10 best writing apps for Android
- Character Story Planner 2
- Google Docs, Drive, and Keep
- Grammarly Keyboard
- JotterPad
- Markor
- Microsoft Word, OneDrive, OneNote
- Novelist
- Pure Writer
- Writer Plus
- Writer Tools
- Write stories on android
- About
Android StoryView Examples and Libraries
What if you want an easy way to show quick stories in your app? One way would to be create full blown fragments and maybe use a viewpager to swipe through them. While this provides unlimited customizations options, it’s not ideal if you only want to display say title, subtitle and image. There are libraries that make this capability easier. We call these libraries, storyView libraries and we want to examine them in this tutorial alongside full examples.
(a). StoryView
StoryView is an Android Library for displaying stories like Facebook.
StoryView allows you create stories with the following:
It requires API 17+.
Step 1: Install it
The first step is installation. The library is hosted in jitpack, so you add this in your project level build.gradle:
And this in your module level build.gradle:
Step 2: Create Stories
You have two options when creating a story:
- Use same header for all images in the story.
- Or use different headers for each image.
You create stories as follows:
Now add the stories to an arraylist:
Reference
Find source code reference here.
Full Example – How to Create a StoryView in Kotlin
In this example we look at how to create a storyview using the library we’ve examine above. The example will be written in Kotlin.
Step 1: Install the library
Install the library as we’d looked above.
Then after installing it we’ll also enable ViewBinding. This will allow us reference widgets defined in our layouts in our kotlin code.
Step 2: Create layout
There is nothing special about our activity_main.xml layout. We only a button that will trigger the displaying ofthe storyview.
Step 3: Write Kotlin Code
Start by creating the main activity:
Now declare the ActivityMainBinding class. It is a generated class. It is generated by the compiler based on the name we assigned the layout file.
Now create a showstories function. This is the fuction responsible for creating and showing our stories:
Here’s the full code:
MainActivity.kt
Run the code in android studio. However make sure you’ve added internet connectivity permission in your android manifest.
Download
Download the code here
report this ad
Oclemy
Thanks for stopping by. My name is Oclemy(Clement Ochieng) and we have selected you as a recipient of a GIFT you may like ! Together with Skillshare we are offering you PROJECTS and 1000s of PREMIUM COURSES at Skillshare for FREE for 1 MONTH. To be eligible all you need is by sign up right now using my profile .
Источник
10 best writing apps for Android
Read more:
Character Story Planner 2
Price: Free (with ads)
Character Story Planner 2 is actually an app for table top gaming. We’re talking about stuff like Dungeons and Dragons, Hackmaster, and similar types of games. However, this can be an excellent resource for novelists and short story writers. You can create characters with back stories, places, creatures, gods, magic, or whatever else you want. You can basically create an entire world with its own rules, characters, races, and places. In addition, the app includes a creation process for scenarios, story events, and other types of scenes. You can basically write a whole book here and then eventually just transpose it into a word processor later. The app is free with advertising so it’s good for writers on a budget too.
Google Docs, Drive, and Keep
Price: Free / $1.99-$199.99 per month
Google Drive is a fairly powerful online office suite. It has a word processor with Google Docs, cloud storage with Google Drive (or Google One), and a note taking app with Google Keep. This is an excellent set of apps for writers. Google Docs is big enough and powerful enough to house a novel, screenplay, etc. I personally use it for script writing for YouTube videos. Google Drive is a cloud storage platform so you can access your writing on a computer, phone, or any other device with an Internet connection. Finally, Google Keep is a decent, free note taking app where you can house ideas and snippets. It all integrates into Google Drive. All of the apps are free and you get 15GB of free Google Drive space. The subscription costs are in case you need more space.
Grammarly Keyboard
Price: Free
Writing with a virtual keyboard is not the ideal way to write things. However, sometimes it’s unavoidable. Grammarly Keyboard is a decent keyboard app for writers. It does basic things like auto-correction for spelling errors. The app also helps with your grammar. It tells you when it spots a grammar issue and offers a correction. Now, in many cases, things are worded a specific way for a reason and some characters just talk with bad grammar. However, it’s still nice having a keyboard with capabilities like this. To be fair, though, we imagine most people are using a Bluetooth keyboard or a Chromebook for this so a keyboard might not be necessary.
JotterPad
Price: Free / $5.99-$14.99 once / $0.99 per month
JotterPad is a writing app specifically for writers. It has a variety of features for things like novels, screenplays, and other similar types of writing work. The app also comes with a no-distraction mode to really get into the zone. Some other features include a dark mode, a word counter, Markdown support, typewriter style scrolling, and support for cloud storage. There is also split-screen support but only on tablets and Chromebooks. The free version comes with most of the features. A single $5.99 purchase adds some extra stuff while the $14.99 option unlocks everything. There is also a $0.99 per month option for cloud storage support. We’re not big fans of paying monthly for support to Google Drive’s free storage, but you can always skip that if you want to.
Markor
Price: Free
Markor is a simple, minimal writing app. It uses Markdown for its formatting, but it’s otherwise a simple editor. The app works as a basic writing app but also has features for taking notes, to-do lists, and more. You also get offline support, a convert-to-PDF reader function, and some other productivity things. It’s a perfectly serviceable writing app for a variety of applications and it’s also entirely free.
See more:
Microsoft Word, OneDrive, OneNote
Price: Free / $5.99-$7.99 per month / $119.99 once
Microsoft Office works a lot like Google Drive. It’s a full office suite with accessibility between all of your devices. Everybody knows about Microsoft Word already. Microsoft OneDrive lets you sync your work between multiple devices and OneNote is a reasonably decent note-taking app. We like Microsoft Office a little more because it comes with native desktop apps for Windows. That’s a nice touch in case you want something on your computer with a little more horsepower. You do need an Office 365 subscription in order to get the desktop apps. The free version lets you use the web version of Word for free. We also appreciate that Microsoft lets you buy the whole Microsoft Office suite for a single $119.99 payment. They used to not do that.
Novelist
Price: Free
Novelist is a free writing app for, well, novelists. It has a variety of features specifically for plotting, writing, preparing, and exporting novels or short stories. That includes a timeline feature for all of the various big scenes in your story. In addition, the app features Google Drive support, multiple formatting options, a powerful book preview feature, and an above average text editor. You can get more features from something like Google Docs or Microsoft Word. However, this app is entirely free and the extra novel specific features make it worthy of consideration. We also like the Material Design UI if that helps.
Pure Writer
Price: Free / $3.99
Pure Writer is another simple, minimal writing app. It features very little to get in the way of your writing. That said, there are paragraph and line spacing options, a dark mode, and an extensive document saving function. It saves as you write. Failing that, it notifies the user and locks the app so it can’t be closed until the document is saved. Finally, you get access to a history feature to recover anything you accidentally deleted. It helps make this one stand out from its many competitors. The pro version is also inexpensive comparatively speaking.
Writer Plus
Price: Free / $0.99-$15.99
Writer Plus is one of the most popular writing apps for just about anything. It has a bunch of features for that sort of stuff, including headers, rich text formatting, undo and redo, keyboard macros, a night mode, right to left text support, and stuff like word and character counters. The minimal UI and easy navigation put little between you and actually writing and we appreciate that. There is also a quick guide on how to use everything. It’s not heavy like you see with Microsoft Word or Google Docs. However, it’s really easy and fast to just jump in and start typing stuff. The app is also entirely free with no advertising. The in-app purchases are optional donations if you want to support development.
Writer Tools
Price: Free / $4.99 per month / $54.99 per year
Writer Tools is another decent writing app with some useful features for writers. This one has a word processor, but the really cool parts are the other features. You can do things like create characters, plot out timelines and chapters, create new locations for your characters, and house other ideas. There is even a quarterly goal section so you can try to keep to a writing schedule. There is also a progress log in case you want to see your writing consistency. You can work on one whole project for free (with ads). There is a subscription to work on multiple projects, add images, and remove ads. However, we don’t think that the subscription service is worth its price tag so we recommend avoiding it if you can.
Thank you for reading! Check these out too:
If we missed any great writing apps for Android, tell us about them in the comments! You can also click here to check out our latest Android app and game lists!
Источник
Write stories on android
- V1.0.6-alpha: RTL Support
- V1.0.2-alpha: Migrated to Java 8, Added OnStoryChangedListener, and Starting the stories from a predefined index
1. Add the gradle dependency
Add JitPack repository to your root build.gradle at the end of repositories:
Add the dependency:
2. Create the StoryView
You have two options, the first one is to use the same header (what I mean by header is the logo, title and the subtitle) for all the images in the story, or to define a custom header for each image. Let’s start first by creating the stories.
A. Constructing the Stories
You have to pass to the library’s builder an ArrayList of ‘MyStory’ where MyStory represents a single story (clearly) and contains the following members:
String url (Required/NotNull): The link of the image
Date date (Optional/Nullable): The date when the story got posted (If you have the date as a String, use a SimpleDateFormat to parse it into a Date object)
String description (Optional/Nullable): The description of the story which gets displayed as shown in the screenshot below:
If you don’t want to display a description along with the image just pass the description as null or as an empty String and it will not be displayed.
Another option is to use the second constructor which takes the url and the date only.
Now, lets construct the Stories ArrayList:
Assume we have an ArrayList of ‘Story’ where the single ‘Story’ contains the fields (imageUrl & date):
B. Construction the Header(s)
B.1 Option one (The same header for all the images)
B.2 Option two (Custom header for each image)
This process is similar to the process of constructing the stories list, instead we have to create an ArrayList of ‘StoryViewHeaderInfo’ which contains the following fields:
Let’s construct the ArrayList:
Assume the same previous example (the ArrayList of Story) but each story in this list has a different person who posted it. Now the story contains these additional fields (username: String, userLocation: String, userImageUrl: String)
B.3 Finally, pass the ArrayList to the Builder:
shts/StoriesProgressView: This Library was used to display the progress of the stories
Mhd Hamza Al Omari
Please feel free to suggest any new features to be added to the Library.
About
StoryView is an Android Library for displaying stories like Facebook
Источник