4
일부 appwidgets은 위젯에서 활동을 시작할 때 makeScaleUpAnimation (JellyBean 4.1에서 도입)을 사용하고 있습니다. 위젯 제공자로부터 뷰를 볼 수 없을 때 어떻게 가능합니까?appwidget에서 makescaleupanimation
전체 appwidgets보기 또는 다른 것을 얻을 수있는 방법이 있습니까? 나는 해결책을 찾을 수 없습니다 ..
ActivityOptions opts = ActivityOptions.makeScaleUpAnimation(view, 0, 0,
view.getWidth(), view.getHeight());
// Request the activity be started, using the custom animation options.
startActivity(new Intent(MainActivity.this, AnimationActivity.class),
opts.toBundle());
을 나는 귀하의 활동이이 정보를 가져 getIntent().getSourceBounds()
를 호출해야 내 위젯
Intent inboxIntent = new Intent(Intent.ACTION_MAIN);
inboxIntent.setType("vnd.android-dir/mms-sms");
int flags = Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_SINGLE_TOP |
Intent.FLAG_ACTIVITY_CLEAR_TOP;
inboxIntent.setFlags(flags);
context.startActivity(inboxIntent);
활동에서 활동을 시작하지 않았지만 그게 바로 열쇠였습니다. 이것은 나의 마지막 코드이다. 빈보기를 만드는 데는 잘못된 느낌이 들지만 작동합니다. '보기보기 = 새보기 (문맥); \t \t \t \t \t \t \t \t \t \t \t \t view.setLayoutParams (신규의 LayoutParams (0,0)); \t \t \t \t \t \t ActivityOptions는 = ActivityOptions.makeScaleUpAnimation (뷰 intent.getSourceBounds(). 왼쪽 intent.getSourceBounds(). 위쪽 \t \t \t \t \t의 opts를 \t \t \t intent.getSourceBounds(). 폭() , intent.getSourceBounds(). height()); \t \t \t \t \t \t \t Context.startActivity에 (threadIntent, opts.toBundle()); 그것은 이상한 함수의' – Thoast83
. 소스 코드를 살펴보면 전달 된'View '는 뷰의 컨텍스트에서 패키지 이름을 얻고 클라이언트 좌표의 경계를 화면 좌표로 변환하는 데에만 사용됩니다. 이 매개 변수를 'Context'로 만들고 화면 좌표만으로 시작하도록하는 것이 더 나았을 것 같습니다. 당신이 전달하는'View '는 화면 상에 위치를 가지지 않기 때문에 (좌표계에 결코 연결되지 않은) 좌표는 마치 화면 좌표와 같이 처리됩니다 (좋은 점은 getSourceBounds()'). –
기본적으로 솔루션은 사용자가 깨닫지 못하는 것보다 더 많은 해킹입니다. 그러나 작동하며 대체 방법이 없습니다. –