Giter Site home page Giter Site logo

s1-next's People

Contributors

allenz8512 avatar floating-cat avatar gy6221 avatar jmnsy avatar tsekityam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

s1-next's Issues

1.0 Roadmap

Dependecies:

  • Use Moshi instead Jackson because Moshi has less methods than Jackson and easy to customize how values are converted to and from JSON.
  • Use auto-value-moshi to simplify models.
  • Two-way data binding and DataBindingComponent.
  • Remove preference-v14 because it is troublesome (we need add styles for different Android versions) and a bit inconsistent with the default platform style. ca94f60
  • Day/night mode from Android Support library. (Auto-switching or not?)
  • Use RxPreferences and remove lazy evaluation for Preferences (huge useless code before).
  • Remove Guava.

Code:

  • Make code more simple.
  • Package by feature.
  • Do not extend Account for some models, because it is impossible to implement correct equality method for inheritance if we add new fields (see Effective Java Item 8).
  • Remove unneeded setter for models.
  • Separate transformation (for JSON deserialization) related code from models.
  • Do not create Retrofit API endpoints (which includes OkHttpClient and JSON related class) in UI-thread because this is a little time consuming (XX ms?).
  • Use database and others instead of NonUIFragment.
  • Log something.

Code style:

  • Remove unneeded blank lines after class/interface declaration.
  • Add blank lines for empty block structure.
  • Do not use Hungarian notation ("m" prefix).

UI:

  • Tweak color palette for themes.
  • Tweak app icon (primary color, color gradient and shadow).
  • Remove shortcut to change theme in drawer?
  • Add placeholder for images.

Feature:

  • Support 安全提问.
  • We can back to the last time thread floor we already read.
  • Redesign ReplyAcitivty (Supporting [s][/s] or something else).
  • Show high resolution if we click avatar. (Drawer and threads)

Android N:

  • Can open ReplyActivity in new window.
  • Data Saver prompt for images.
  • Launcher shortcuts for specific forums or threads.
  • Scoped directory access.

Others:

Then…

0.2.0 Roadmap

High priority

  • Rely (with floating action button), not support Emoji. 8d73f50
  • Multi-touch for image. ae89360
  • Log out. 101d0e6
  • Action Bar can scroll off screen with the content and come back when the user reverse-scrolls, same to floating action button.

Normal priority

  • Support all text color for reply. 3af009e
  • Encode HTML entities for post title. ddbd6b1

Unable to show images if OOM

Like http://bbs.saraba1st.com/2b/thread-1140683-1-1.html

08-05 21:11:27.198    7754-8111/cl.monsoon.s1next.debug E/art﹕ Throwing OutOfMemoryError "Failed to allocate a 6291468 byte allocation with 3547596 free bytes and 3MB until OOM"
08-05 21:11:27.198    7754-8111/cl.monsoon.s1next.debug D/skia﹕ --- decoder->decode returned false
08-05 21:11:27.201    7754-8111/cl.monsoon.s1next.debug E/PriorityExecutor﹕ Request threw uncaught throwable
    java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Failed to allocate a 6291468 byte allocation with 3547596 free bytes and 3MB until OOM
            at java.util.concurrent.FutureTask.report(FutureTask.java:93)
            at java.util.concurrent.FutureTask.get(FutureTask.java:163)
            at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor.afterExecute(FifoPriorityThreadPoolExecutor.java:96)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1120)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
            at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:118)
     Caused by: java.lang.OutOfMemoryError: Failed to allocate a 6291468 byte allocation with 3547596 free bytes and 3MB until OOM
            at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
            at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
            at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:635)
            at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:611)
            at com.bumptech.glide.load.resource.bitmap.Downsampler.decodeStream(Downsampler.java:329)
            at com.bumptech.glide.load.resource.bitmap.Downsampler.downsampleWithSize(Downsampler.java:220)
            at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:153)
            at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:50)
            at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:19)
            at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:39)
            at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:20)
            at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decodeBitmapWrapper(GifBitmapWrapperResourceDecoder.java:121)
            at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decodeStream(GifBitmapWrapperResourceDecoder.java:94)
            at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:71)
            at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:61)
            at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:22)
            at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperStreamResourceDecoder.decode(GifBitmapWrapperStreamResourceDecoder.java:24)
            at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperStreamResourceDecoder.decode(GifBitmapWrapperStreamResourceDecoder.java:14)
            at com.bumptech.glide.load.resource.file.FileToStreamDecoder.decode(FileToStreamDecoder.java:39)
            at com.bumptech.glide.load.resource.file.FileToStreamDecoder.decode(FileToStreamDecoder.java:17)
            at com.bumptech.glide.load.engine.DecodeJob.loadFromCache(DecodeJob.java:222)
            at com.bumptech.glide.load.engine.DecodeJob.cacheAndDecodeSourceData(DecodeJob.java:207)
            at com.bumptech.glide.load.engine.DecodeJob.decodeFromSourceData(DecodeJob.java:187)
            at com.bumptech.glide.load.engine.DecodeJob.decodeSource(DecodeJob.java:177)
            at com.bumptech.glide.load.engine.DecodeJob.decodeFromSource(DecodeJob.java:128)
            at com.bumptech.glide.load.engine.EngineRunnable.decodeFromSource(EngineRunnable.java:122)
            at com.bumptech.glide.load.engine.EngineRunnable.decode(EngineRunnable.java:101)
            at com.bumptech.glide.load.engine.EngineRunnable.run(EngineRunnable.java:58)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
            at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:118)

Code refactoring

Current app architecture sucks, and Account model contains controller logic.

Structure:

Dependencies

  • Use Retrofit and RxAndroid instead of AsyncTaskLoader.
  • Use RxJava instead of Otto.

Others:

  • Separate ToolbarDelegate and DrawerDelegate from BaseActivity.
  • Reuse ViewPager's logic for ThreadListFragment, PostListActivity and FavouriteListFragment.

Abort:

  • Use MVP.
  • Rewritten some code in Kotlin.

验证码验证失败

最近论坛登陆时要求验证码,但是用app登陆时,即使输入了正确的验证码,app依然提示验证码错误,从而无法登陆。

Save JSONs in disk LRU cache

This is trivial to define a schema and contract in order to save data in database.
So current we only store JSONs to disk LRU cache which use the API URLs as keys.

Flow:
HTTP request -> JSON deserialization -> store JSONs in disk LRU cache (when deserialized successfully) -> show data

Support edit

Get reply (HTTP GET):
http://bbs.saraba1st.com/2b/forum.php?mod=post&action=edit&tid=1074030&pid=27234232&inajax=yes

<textarea name="message" id="e_textarea" class="pt" rows="15" tabindex="2">[quote][size=2][url=forum.php?mod=redirect&amp;amp;amp;goto=findpost&amp;amp;amp;pid=27219172&amp;amp;amp;ptid=1074030][color=#999999]sabermio 发表于 2014-11-14 16:26[/color][/url][/size]
 大家喜欢用网页的最重要原因是可以多开啊!这个功能希望能加上[/quote] 这个功能在手机上应该很难,不过现在无论是主题页面还是回复页面都会预加载上下一页。</textarea>

note: escape &amp;

Update reply (HTTP POST):
http://bbs.saraba1st.com/2b/forum.php?mod=post&action=edit&inajax=yes&editsubmit=yes

180
<?xml version="1.0" encoding="utf-8"?>
<root><![CDATA[<script type="text/javascript" reload="1">if(typeof succeedhandle_=='function') {succeedhandle_('forum.php?mod=viewthread&tid=1074030&page=&extra=#pid27234232', '帖子编辑成功,现在将转入主题页,请稍候……[ 点击这里转入主题列表 ]', {'fid':'51','tid':'1074030','pid':'27234232'});}</script>]]></root>
0
133
<?xml version="1.0" encoding="utf-8"?>
<root><![CDATA[抱歉,指定的主题不存在或已被删除或正在被审核<script type="text/javascript" reload="1">if(typeof errorhandle_=='function') {errorhandle_('抱歉,指定的主题不存在或已被删除或正在被审核', {});}</script>]]></root>
0

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.