搜尋此網誌

顯示具有 轉載 標籤的文章。 顯示所有文章
顯示具有 轉載 標籤的文章。 顯示所有文章

2020年4月15日 星期三

temp 流水帳

source:https://unsplash.com/photos/pv2ZlDfstXc

樓上漏水,家人先修好,但費用樓上不想出。
https://www.mobile01.com/topicdetail.php?f=335&t=5480094&p=3

樓上漏水要我負責?別自認倒楣!3步驟解決漏水糾紛
https://www.moneynet.com.tw/article/6549/%E6%A8%93%E4%B8%8A%E6%BC%8F%E6%B0%B4%E8%A6%81%E6%88%91%E8%B2%A0%E8%B2%AC%E5%88%A5%E8%87%AA%E8%AA%8D%E5%80%92%E6%A5%A33%E6%AD%A5%E9%A9%9F%E8%A7%A3%E6%B1%BA%E6%BC%8F%E6%B0%B4%E7%B3%BE%E7%B4%9B

EP22 房屋漏水怎麼辦?律師教你解決SOP |巴毛律師晚自習
https://www.youtube.com/watch?v=9l5aws-sCjk


豪宅漏水,樓上賠
https://www.peopo.org/news/258701


老公寓整修 遭檢舉罰6萬
https://news.ltn.com.tw/news/local/paper/615437

換浴缸漏水擾鄰 劉若英判賠
https://www.tbca.org.tw/content-page/17-faq/1185-2019-03-27-11-27-13.html

樓上住戶漏水,可請求慰撫金
https://www.tbca.org.tw/content-page/17-faq/1108-2019-03-27-10-48-32.html


發現漏水  6個月內要主張權利
https://www.youtube.com/watch?v=_Y31MoFJ-FY

漏水問題: 
冷熱水管為進水管.管裂滲水1.水表會微動 2.漏水情形是持續性不間斷 
排水管管裂或管邊滲水或銜接處滲水 1. 為間歇性(也就是有使用到此排水管時才會漏水).
https://www.mobile01.com/topicdetail.php?f=335&t=1451685


浴廁管線破裂發生滲漏
http://www.shengwui.com.tw/prod/3b1ef00d981948359fc7d76e02f0bb85

2018年4月15日 星期日

【Android】RecyclerView 進階文章 - ItemDecoration(範例 分隔線)


下圖片 code來自https://github.com/thinkSky1206。

為RecyclerView添加分隔線

主頁面layout布局很基本的。
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/md_grey_300"> //設定灰色背景
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
宣告class去繼承RecyclerView.ItemDecoration,改寫getItemOffsets方法
public class SimplePaddingDecoration extends RecyclerView.ItemDecoration {
private int dividerHeight;
public SimplePaddingDecoration(Context context) {
Resource res = context.getResources();
dividerHeight = res.getDimensionPixelSize(R.dimen.divider_height);
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
outRect.bottom = dividerHeight; //為itemView添加長度為dividerHeight的間隔(留白)
}
}
使用自定義的itemDecoration
recyclerView.addItemDecoration(new SimplePaddingDecoration(this));
結果:




這樣就完成一個簡單的帶有分隔線的view。
缺點:
分隔線的顏色是因為背景色,若我們想分隔線和背景為不同顏色,此方法不可行。

public class SimpleDividerDecoration extends RecyclerView.ItemDecoration {
private int dividerHeight; //分隔線高度
private Paint dividerPaint; //繪製分隔線的paint
public SimpleDividerDecoration(Context context) {
Resource res = context.getResources();
dividerPaint = new Paint();
dividerPaint.setColor(context.getResources().getColor(R.color.colorAccent));
dividerHeight = res.getDimensionPixelSize(R.dimen.divider_height);
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
outRect.bottom = dividerHeight;
}
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
/**
* childCount : 取得recycleView所擁有的itemView總數
* left : RecyclerView 的左邊界加上 paddingLeft距離 後的坐標位置
* right : RecyclerView 的右邊界減去 paddingRight 後的坐標位置
*/
int childCount = parent.getChildCount();
int left = parent.getPaddingLeft();
int right = parent.getWidth() - parent.getPaddingRight();
//
for (int i = 0; i < childCount - 1; i++) {
View view = parent.getChildAt(i);
float top = view.getBottom();
float bottom = view.getBottom() + dividerHeight;
c.drawRect(left, top, right, bottom, dividerPaint);
}
}
}
結果: