use of com.instructure.speedgrader.views.HelveticaTextView in project instructure-android by instructure.
the class HomeActivity method intAboutPage.
public void intAboutPage() {
final ImageView helpButtonArrow = (ImageView) findViewById(R.id.helpButtonArrow);
final ImageView reportProblemButtonArrow = (ImageView) findViewById(R.id.reportProblemButtonArrow);
final ImageView aboutArrow = (ImageView) findViewById(R.id.aboutButtonArrow);
final ImageView aboutArrowBack = (ImageView) findViewById(R.id.aboutButtonArrowBack);
// Set the colors for our arrows
final Drawable arrow = CanvasContextColor.getColoredDrawable(getContext(), R.drawable.ic_cv_arrow_right, getContext().getResources().getColor(R.color.sg_lightGrayText));
final Drawable arrowBack = CanvasContextColor.getColoredDrawable(getContext(), R.drawable.ic_cv_arrow_left, getContext().getResources().getColor(R.color.sg_lightGrayText));
helpButtonArrow.setImageDrawable(arrow);
reportProblemButtonArrow.setImageDrawable(arrow);
aboutArrowBack.setImageDrawable(arrowBack);
aboutArrow.setImageDrawable(arrow);
final ViewSwitcher aboutViewSwitcher = (ViewSwitcher) findViewById(R.id.aboutViewSwitcher);
final HelveticaTextView versionNumber = (HelveticaTextView) findViewById(R.id.sg_about_version_text);
final HelveticaTextView accountName = (HelveticaTextView) findViewById(R.id.sg_about_account_text);
// Set Version Number
try {
versionNumber.setText(getPackageManager().getPackageInfo(getPackageName(), 0).versionName + " (" + getPackageManager().getPackageInfo(getPackageName(), 0).versionCode + ")");
} catch (Exception e) {
versionNumber.setText("");
}
// Copyright Text
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
HelveticaTextView copyrightText = (HelveticaTextView) findViewById(R.id.sg_about_copyright_text);
String yearText = String.format(getString(R.string.copyrightText, String.valueOf(year)));
copyrightText.setText(yearText);
accountName.setText(APIHelpers.getCacheUser(getContext()).getEmail());
aboutButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!showingAbout) {
showingAbout = !showingAbout;
aboutViewSwitcher.setInAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.slide_in_left));
aboutViewSwitcher.setOutAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.slide_out_right));
aboutViewSwitcher.setDisplayedChild(1);
aboutArrowBack.setVisibility(View.VISIBLE);
aboutArrow.setVisibility(View.INVISIBLE);
} else {
showingAbout = !showingAbout;
// left to right
aboutViewSwitcher.setInAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.slide_in_right));
aboutViewSwitcher.setOutAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.slide_out_left));
aboutViewSwitcher.setDisplayedChild(0);
aboutArrowBack.setVisibility(View.GONE);
aboutArrow.setVisibility(View.VISIBLE);
}
}
});
}
use of com.instructure.speedgrader.views.HelveticaTextView in project instructure-android by instructure.
the class HomeActivity method initNavigationDrawer.
public void initNavigationDrawer() {
// User Data
avatar = (CircleImageView) findViewById(R.id.profile_image);
userName = (HelveticaTextView) findViewById(R.id.userName);
aboutButton = (RelativeLayout) findViewById(R.id.aboutButton);
helpButton = (RelativeLayout) findViewById(R.id.helpButton);
reportProblemButton = (RelativeLayout) findViewById(R.id.reportProblemButton);
navigationHeader = (LinearLayout) findViewById(R.id.navigationHeader);
UserAPI.getSelf(userCallback);
intAboutPage();
initSettingsListeners();
initLogoutButton();
initMasquerading();
// Help Button
helpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(InternalWebviewActivity.createIntent(getContext(), com.instructure.pandautils.utils.Const.CANVAS_USER_GUIDES, false));
overridePendingTransition(R.anim.slide_down, 0);
}
});
reportProblemButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ZendeskDialogStyled dialog = new ZendeskDialogStyled();
dialog.show(getSupportFragmentManager(), ZendeskDialogStyled.TAG);
}
});
}
use of com.instructure.speedgrader.views.HelveticaTextView in project instructure-android by instructure.
the class HomeActivity method initSettingsListeners.
public void initSettingsListeners() {
final SwitchCompat hideNamesSwitch = (SwitchCompat) findViewById(R.id.sg_options_hideNames_switch);
final SwitchCompat showUngradedFirstSwitch = (SwitchCompat) findViewById(R.id.sg_options_showUngradedFirst_switch);
final SwitchCompat showUngradedCountSwitch = (SwitchCompat) findViewById(R.id.sg_options_viewUngradedCount_switch);
final HelveticaTextView hideNamesLabel = (HelveticaTextView) findViewById(R.id.sg_options_hideNames);
final HelveticaTextView showUngradedFirstLabel = (HelveticaTextView) findViewById(R.id.sg_options_showUngradedFirst);
final HelveticaTextView viewUngradedCountLabel = (HelveticaTextView) findViewById(R.id.sg_options_viewUngradedCount);
final ImageView pulse = (ImageView) findViewById(R.id.pulse);
new TutorialUtils(HomeActivity.this, App.getPrefs(), pulse, TutorialUtils.TYPE.COLOR_CHANGING_DIALOG).setContent(getString(R.string.tutorial_tipHideStudentNames), getString(R.string.tutorial_tipHideStudentNamesMessage)).build();
hideNamesLabel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hideNamesSwitch.toggle();
}
});
showUngradedFirstLabel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showUngradedFirstSwitch.toggle();
}
});
viewUngradedCountLabel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showUngradedCountSwitch.toggle();
}
});
// Set Switch defaults
final App applicationManager = (App) getApplication();
// Set Default values for our switches
hideNamesSwitch.setChecked(applicationManager.showStudentNames());
showUngradedFirstSwitch.setChecked(applicationManager.showUngradedStudentsFirst());
showUngradedCountSwitch.setChecked(applicationManager.showUngradedCount());
// set On check changed listeners
hideNamesSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
applicationManager.setShowStudentNames(isChecked);
}
});
showUngradedFirstSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
applicationManager.setShowUngradedStudentsFirst(isChecked);
}
});
showUngradedCountSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
applicationManager.setShowUngradedCount(isChecked);
if (getSupportFragmentManager().findFragmentById(R.id.content_frame) instanceof OnSettingsChangedListener) {
((OnSettingsChangedListener) getSupportFragmentManager().findFragmentById(R.id.content_frame)).onShowUngradedCountChanged(isChecked);
}
}
});
}
use of com.instructure.speedgrader.views.HelveticaTextView in project instructure-android by instructure.
the class SubmissionCommentRowFactory method buildRowView.
// ///////////////////////////////////////////////////////////////
// Row Factories
// ///////////////////////////////////////////////////////////////
public static View buildRowView(View convertView, LayoutInflater inflater, SubmissionComment comment, final Activity context, boolean isUser) {
final ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
if (isUser) {
convertView = inflater.inflate(R.layout.list_item_user_comment, null);
} else {
convertView = inflater.inflate(R.layout.list_item_other_comment, null);
}
holder.avatar = (CircleImageView) convertView.findViewById(R.id.avatar);
holder.comment = (HelveticaTextView) convertView.findViewById(R.id.commentText);
holder.date = (HelveticaTextView) convertView.findViewById(R.id.date);
holder.attachmentsHolder = (LinearLayout) convertView.findViewById(R.id.attachmentsHolder);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
String avatarURL = comment.getAuthor().getAvatarImageUrl();
if (avatarURL != null) {
Picasso.with(context).load(avatarURL).into(holder.avatar, new Callback() {
@Override
public void onSuccess() {
}
@Override
public void onError() {
holder.avatar.setImageResource(R.drawable.ic_cv_user);
}
});
}
holder.comment.setText(comment.getComment());
holder.date.setText(DateHelpers.getShortDate(context, comment.getComparisonDate()) + context.getString(R.string.at) + DateHelpers.getFormattedTime(context, comment.getComparisonDate()) + ", " + comment.getAuthor().getDisplayName());
holder.attachmentsHolder.removeAllViews();
List<Attachment> attachments = comment.getAttachments();
if (attachments != null) {
for (final Attachment attachment : attachments) {
if (attachment.getThumbnailUrl() != null && attachment.getUrl() != null) {
ImageView imageView = getAttachmentImageView(context);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((SubmissionListener) context).onMediaOpened(attachment.getMimeType(), attachment.getUrl(), attachment.getFilename());
}
});
Picasso.with(context).load(attachment.getThumbnailUrl()).into(imageView);
holder.attachmentsHolder.addView(imageView);
}
}
}
final MediaComment mediaComment = comment.getMedia_comment();
if (mediaComment != null) {
final String url = APIHelpers.getFullDomain(context) + "/media_objects/" + mediaComment.getMediaId() + "/thumbnail?height=140&width=140";
ImageView imageView = getAttachmentImageView(context);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((SubmissionListener) context).onMediaOpened(mediaComment.getMimeType(), mediaComment.getUrl(), mediaComment.getFileName());
}
});
Picasso.with(context).load(url).into(imageView);
holder.attachmentsHolder.addView(imageView);
}
return convertView;
}
use of com.instructure.speedgrader.views.HelveticaTextView in project instructure-android by instructure.
the class EmptyViewFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
getBundleData(getArguments());
View rootView = inflateLayout(inflater, container);
final HelveticaTextView message = (HelveticaTextView) rootView.findViewById(R.id.emptyMessage);
message.setText(messageToUser);
return rootView;
}
Aggregations