floating-cat / s1-next Goto Github PK
View Code? Open in Web Editor NEWLicense: The Unlicense
License: The Unlicense
Reply content is empty in some posts on S1, such as [http://bbs.saraba1st.com/2b/thread-1008413-1-1.html], cause the post list activity shutdown.
Code at PostListRecyclerAdapter.java,line 115.
382f957#diff-d2a554428ced185d821c8e3241eab312R37 call OkHttp#setRetryOnConnectionFailure(false)
for POST request in order to avoid retries.
Looks this issue was caused by square/okhttp#1146.
So current we do not disable retry for post request. If OkHttp still silently retries on POST request, than reopen this issue.
Dependecies:
auto-value-moshi
to simplify models.DataBindingComponent
.preference-v14
because it is troublesome (we need add styles for different Android versions) and a bit inconsistent with the default platform style. ca94f60Preferences
(huge useless code before).Code:
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).OkHttpClient
and JSON related class) in UI-thread because this is a little time consuming (XX ms?).NonUIFragment
.Code style:
UI:
Feature:
ReplyAcitivty
(Supporting [s][/s]
or something else).Android N:
ReplyActivity
in new window.Others:
Then…
Like http://bbs.saraba1st.com/2b/api/mobile/index.php?module=viewthread&tid=1075841&ppp=10&page=1
The first floor's content is
<i class="pstatus"> 本帖最后由 samuel-kim 于 2014-11-21 18:23 编辑 </i><br />
<br />
这绝逼比地铁那个赞多好吗 (图补58L)[attach]284756[/attach]<br />
But the attachments of JSON are 284757 and 284755
Use of Vector images (.svg) when developing/designing, and the IDE would automatically generate bitmap images for all the different resolutions on build.
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)
logcat:
TextView does not support text selection. Action mode cancelled.
https://github.com/floating-cat/S1-Next/blob/master/app/src/main/res/layout/item_post.xml doesn't support text selection in some devices.
But it works for AOSP 4.4.4 devices and above.
After debugged Editor, still can't find out the reason.
http://bbs.saraba1st.com/2b/search.php?mod=forum&srchtxt=example&searchsubmit=yes&formhash=8cec6495
note: no sure whether formhash
makes sense.
Current the 3b7eff2 remove the scrolling effect (auto hide Toolbar and FloatingActionButton).
Later we will implement it by using CoordinatorLayout.Behavior
.
Current app architecture sucks, and Account
model contains controller logic.
Structure:
Dependencies
AsyncTaskLoader
.Others:
ToolbarDelegate
and DrawerDelegate
from BaseActivity
.ViewPager
's logic for ThreadListFragment
, PostListActivity
and FavouriteListFragment
.Abort:
https://github.com/floating-cat/S1-Next/blob/master/app/src/main/java/cl/monsoon/s1next/view/activity/ThreadListActivity.java#L110
and
https://github.com/floating-cat/S1-Next/blob/master/app/src/main/java/cl/monsoon/s1next/view/fragment/PostListFragment.java#L240
doesn't display sometims.
May related to https://code.google.com/p/android/issues/detail?id=29472
最近论坛登陆时要求验证码,但是用app登陆时,即使输入了正确的验证码,app依然提示验证码错误,从而无法登陆。
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
Current the POST request calls twice if users press HOME button and come back or off screen.
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;goto=findpost&amp;amp;pid=27219172&amp;amp;ptid=1074030][color=#999999]sabermio 发表于 2014-11-14 16:26[/color][/url][/size]
大家喜欢用网页的最重要原因是可以多开啊!这个功能希望能加上[/quote] 这个功能在手机上应该很难,不过现在无论是主题页面还是回复页面都会预加载上下一页。</textarea>
note: escape &
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.