@@ -33,7 +33,7 @@ import ai.pai.client.utils.SystemUtils; |
||
| 33 | 33 |
import ai.pai.client.utils.UmengEvent; |
| 34 | 34 |
import ai.pai.client.views.GroupQRPopup; |
| 35 | 35 |
|
| 36 |
-public class GroupActivity extends BaseActivity implements View.OnClickListener {
|
|
| 36 |
+public class GroupActivity extends BaseActivity implements View.OnClickListener,GroupQRFragment.GroupIdFetchListener {
|
|
| 37 | 37 |
|
| 38 | 38 |
private String groupId; |
| 39 | 39 |
private File photoFile; |
@@ -73,6 +73,8 @@ public class GroupActivity extends BaseActivity implements View.OnClickListener |
||
| 73 | 73 |
if (intent.getSerializableExtra("group") == null) {
|
| 74 | 74 |
groupName = intent.getStringExtra("name");
|
| 75 | 75 |
defaultAvatarId = intent.getIntExtra("avatar", 0);
|
| 76 |
+ findViewById(R.id.title_bar_option_layout).setVisibility(View.INVISIBLE); |
|
| 77 |
+ findViewById(R.id.title_bar_qrcode_layout).setVisibility(View.INVISIBLE); |
|
| 76 | 78 |
showQRFragment(); |
| 77 | 79 |
} else {
|
| 78 | 80 |
GroupInfo info = (GroupInfo) intent.getSerializableExtra("group");
|
@@ -184,6 +186,7 @@ public class GroupActivity extends BaseActivity implements View.OnClickListener |
||
| 184 | 186 |
FragmentTransaction ft = fm.beginTransaction(); |
| 185 | 187 |
if (qrFragment == null) {
|
| 186 | 188 |
qrFragment = new GroupQRFragment(); |
| 189 |
+ qrFragment.setGroupIdFetchListener(this); |
|
| 187 | 190 |
Bundle bundle = new Bundle(); |
| 188 | 191 |
bundle.putString("name", groupName);
|
| 189 | 192 |
bundle.putInt("avatar", defaultAvatarId);
|
@@ -231,4 +234,10 @@ public class GroupActivity extends BaseActivity implements View.OnClickListener |
||
| 231 | 234 |
},4000); |
| 232 | 235 |
} |
| 233 | 236 |
|
| 237 |
+ @Override |
|
| 238 |
+ public void onGroupIdFetched(String groupId) {
|
|
| 239 |
+ this.groupId = groupId; |
|
| 240 |
+ findViewById(R.id.title_bar_option_layout).setVisibility(View.VISIBLE); |
|
| 241 |
+ findViewById(R.id.title_bar_qrcode_layout).setVisibility(View.VISIBLE); |
|
| 242 |
+ } |
|
| 234 | 243 |
} |
@@ -40,7 +40,7 @@ public class GroupQRFragment extends BaseFragment {
|
||
| 40 | 40 |
private String groupId; |
| 41 | 41 |
private String groupName; |
| 42 | 42 |
private int defaultAvatarId; |
| 43 |
- |
|
| 43 |
+ private GroupIdFetchListener listener; |
|
| 44 | 44 |
|
| 45 | 45 |
@Override |
| 46 | 46 |
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
@@ -62,6 +62,10 @@ public class GroupQRFragment extends BaseFragment {
|
||
| 62 | 62 |
} |
| 63 | 63 |
} |
| 64 | 64 |
|
| 65 |
+ public void setGroupIdFetchListener(GroupIdFetchListener listener){
|
|
| 66 |
+ this.listener = listener; |
|
| 67 |
+ } |
|
| 68 |
+ |
|
| 65 | 69 |
public String getGroupId(){
|
| 66 | 70 |
return groupId; |
| 67 | 71 |
} |
@@ -118,7 +122,9 @@ public class GroupQRFragment extends BaseFragment {
|
||
| 118 | 122 |
|
| 119 | 123 |
initQRImageSize(); |
| 120 | 124 |
super.onPostSuccess(context); |
| 121 |
- |
|
| 125 |
+ if(listener!=null){
|
|
| 126 |
+ listener.onGroupIdFetched(groupId); |
|
| 127 |
+ } |
|
| 122 | 128 |
try{
|
| 123 | 129 |
groupQRImg.setImageBitmap(QRCreateUtils.Create2DCode(UrlContainer.QR_APP_GROUP_URL+groupId,codeWidth)); |
| 124 | 130 |
groupJoinHintText.setVisibility(View.VISIBLE); |
@@ -144,4 +150,9 @@ public class GroupQRFragment extends BaseFragment {
|
||
| 144 | 150 |
params.height = codeWidth; |
| 145 | 151 |
groupQRImg.setLayoutParams(params); |
| 146 | 152 |
} |
| 153 |
+ |
|
| 154 |
+ public interface GroupIdFetchListener{
|
|
| 155 |
+ void onGroupIdFetched(String groupId); |
|
| 156 |
+ } |
|
| 157 |
+ |
|
| 147 | 158 |
} |