mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-11-23 22:09:30 +00:00
Added progress wheel while sending messages
This commit is contained in:
parent
fee72680ae
commit
197bd9fe40
@ -18,6 +18,7 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.communiquons.android.comunic.client.R;
|
import org.communiquons.android.comunic.client.R;
|
||||||
@ -114,6 +115,11 @@ public class ConversationFragment extends Fragment
|
|||||||
*/
|
*/
|
||||||
private ImageButton send_button;
|
private ImageButton send_button;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Conversation new message progress bar
|
||||||
|
*/
|
||||||
|
private ProgressBar new_message_progress_bar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversation add image button
|
* Conversation add image button
|
||||||
*/
|
*/
|
||||||
@ -192,6 +198,7 @@ public class ConversationFragment extends Fragment
|
|||||||
new_message_content = view.findViewById(R.id.fragment_conversation_newmessage_content);
|
new_message_content = view.findViewById(R.id.fragment_conversation_newmessage_content);
|
||||||
pick_image_button = view.findViewById(R.id.fragment_conversation_newmessage_pickimage);
|
pick_image_button = view.findViewById(R.id.fragment_conversation_newmessage_pickimage);
|
||||||
send_button = view.findViewById(R.id.fragment_conversation_newmessage_send);
|
send_button = view.findViewById(R.id.fragment_conversation_newmessage_send);
|
||||||
|
new_message_progress_bar = view.findViewById(R.id.fragment_conversation_newmessage_loading);
|
||||||
|
|
||||||
//Make send button lives
|
//Make send button lives
|
||||||
send_button.setOnClickListener(new View.OnClickListener() {
|
send_button.setOnClickListener(new View.OnClickListener() {
|
||||||
@ -215,6 +222,9 @@ public class ConversationFragment extends Fragment
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Hide new message sending wheel
|
||||||
|
new_message_progress_bar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -390,7 +400,8 @@ public class ConversationFragment extends Fragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Hide the send button
|
//Hide the send button
|
||||||
send_button.setVisibility(View.INVISIBLE);
|
send_button.setVisibility(View.GONE);
|
||||||
|
new_message_progress_bar.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
//Get the message content
|
//Get the message content
|
||||||
final String message_content = new_message_content.getText()+"";
|
final String message_content = new_message_content.getText()+"";
|
||||||
@ -435,6 +446,7 @@ public class ConversationFragment extends Fragment
|
|||||||
|
|
||||||
//Make the "send" button available again
|
//Make the "send" button available again
|
||||||
send_button.setVisibility(View.VISIBLE);
|
send_button.setVisibility(View.VISIBLE);
|
||||||
|
new_message_progress_bar.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,11 @@
|
|||||||
android:src="@android:drawable/ic_menu_send"
|
android:src="@android:drawable/ic_menu_send"
|
||||||
android:contentDescription="@string/conversation_message_send"/>
|
android:contentDescription="@string/conversation_message_send"/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/fragment_conversation_newmessage_loading"
|
||||||
|
android:layout_width="@dimen/fragment_conversation_buttons_width"
|
||||||
|
android:layout_height="@dimen/fragment_conversation_buttons_height" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user