仿Boss直聘 檢視頭像

2021-09-20 04:52:11 字數 4091 閱讀 7443

gif.gif

怎麼用?

@override

public void onclick(view v) else if (r.id.iv == v.getid())

}

原理很簡單,

package org.alex.bosszoomanim;

import org.alex.util.logutil;

public bosszoomhelper(final activity activity, final view originalview)

public bosszoomhelper(final activity activity, final view originalview, final long duration)

final contentframelayout container = (contentframelayout) activity.findviewbyid(android.r.id.content);

copyimageview = new imageview(activity);

int matchparent = framelayout.layoutparams.match_parent;

framelayout.layoutparams params = new framelayout.layoutparams(matchparent, matchparent);

copyimageview.setlayoutparams(params);

if (originalview instanceof imageview) else

}copyimageview.setvisibility(view.gone);

container.addview(copyimageview);

final rect startrect = new rect();

final rect endrect = new rect();

point offsetpoint = new point();

originalview.getglobalvisiblerect(startrect);

/\*\*

\* r 是 絕對(global)座標引數,包含狀態列、actionbar、底部虛擬鍵

\* globaloffset 用於將global座標轉換成local座標,這裡的local座標,是相對於內容區的座標,也就是除了狀態列和action bar和虛擬按鍵的區域。

\* \*/

container.getglobalvisiblerect(endrect, offsetpoint);

startrect.offset(-offsetpoint.x, -offsetpoint.y);

endrect.offset(-offsetpoint.x, -offsetpoint.y);

final float startscale;

float scalesize;

float startscalefinal;

logutil.e("-offsetpoint.x = " + (-offsetpoint.x) + " -offsetpoint.y = " + (-offsetpoint.y));

logutil.e("startrect.width() = " + startrect.width() + " startrect.height() = " + startrect.height());

logutil.e("endrect.width() = " + endrect.width() + " endrect.height() = " + endrect.height());

if ((float) endrect.width() / (float) endrect.height() > (float) startrect.width() / (float) startrect.height()) else

copyimageview.setpivotx(0.0f);

copyimageview.setpivoty(0.0f);

animatorset showanimatorset = new animatorset();

showanimatorset.setduration(duration);

showanimatorset.play(objectanimator.offloat(copyimageview, view.x, new float))

.with(objectanimator.offloat(copyimageview, view.y, new float))

.with(objectanimator.offloat(copyimageview, view.scale_x, new float))

.with(objectanimator.offloat(copyimageview, view.scale_y, new float));

showanimatorset.setinterpolator(new decelerateinterpolator());

showanimatorset.addlistener(new animatorlisteneradapter()

public void onanimationend(animator animation)

public void onanimationcancel(animator animation)

});showanimatorset.start();

animator = showanimatorset;

copyimageview.setonclicklistener(new view.onclicklistener()

copyimageview.setbackgroundcolor(0);

animatorset hiddenanimatorset = new animatorset();

hiddenanimatorset.play(objectanimator.offloat(copyimageview, view.x, new float))

.with(objectanimator.offloat(copyimageview, view.y, new float))

.with(objectanimator.offloat(copyimageview, view.scale_x, new float))

.with(objectanimator.offloat(copyimageview, view.scale_y, new float));

hiddenanimatorset.setinterpolator(new decelerateinterpolator());

hiddenanimatorset.setduration(duration);

hiddenanimatorset.addlistener(new animatorlisteneradapter()

public void onanimationend(animator animation)

destroy(originalview, container);

}public void onanimationcancel(animator animation)

});hiddenanimatorset.start();

animator = hiddenanimatorset;

}});

}private void destroy(view originalview, contentframelayout container)

private bitmap view2bitmap(view view)

bitmap bp;

bp = bitmap.createbitmap(bmp, 0, 0, bmp.getwidth(), bmp.getheight());

view.destroydrawingcache();

return bp;

}

仿Boss直聘我的介面滑動效果

好久沒有寫部落格了,最近在找工作,我在使用boss投簡歷的時候,看到boss的我的介面蠻有意思的,就想如何去實現它,可能是職業病吧,所以就打算仿一下。先看下仿的效果。其實我們拿到這個效果的時候,看到滑動,摺疊等效果就應該想到了material design,那麼我們現在就可以基本的布局下。activ...

抓取boss直聘的資訊

from bs4 import beautifulsoup import requests import ip proxy from urllib import parse def get boss info my ip,detailed url url proxy response request...

Scrapy實戰 爬Boss直聘

我們爬取頁面中每個公司的崗位資訊,包括職位 辦公地點 工作經驗 上圖中的11個加上boss直聘的jobid共12個資訊 開啟shell scrapy shell view response 發現返回403 嘗試把headers一併給出 from scrapy import request fetch...