Removing unnecessary work adapter wrapper

Simplifying view type constants to make it easier to add new view types

Bug: 234008165
Test: Verified on device
Change-Id: I96589ceba362ea7e75afdfc3fe8da3be214aa682
This commit is contained in:
Sunny Goyal
2022-07-15 16:23:02 -07:00
parent 6c057718ac
commit cba5f9a64e
8 changed files with 87 additions and 172 deletions

View File

@@ -23,9 +23,11 @@ import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.model.StringCache;
import com.android.launcher3.views.ActivityContext;
/**
@@ -49,12 +51,27 @@ public class WorkPausedCard extends LinearLayout implements View.OnClickListener
mActivityContext = ActivityContext.lookupContext(getContext());
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mBtn = findViewById(R.id.enable_work_apps);
mBtn.setOnClickListener(this);
StringCache cache = mActivityContext.getStringCache();
if (cache != null) {
setWorkProfilePausedResources(cache);
}
}
private void setWorkProfilePausedResources(StringCache cache) {
TextView title = findViewById(R.id.work_apps_paused_title);
title.setText(cache.workProfilePausedTitle);
TextView body = findViewById(R.id.work_apps_paused_content);
body.setText(cache.workProfilePausedDescription);
TextView button = findViewById(R.id.enable_work_apps);
button.setText(cache.workProfileEnableButton);
}
@Override