Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use GitHub’s search feature to search the wiki #4961

Merged
merged 11 commits into from
May 9, 2023
16 changes: 16 additions & 0 deletions wiki/Accessibility-A11y-Guide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## Table of Contents

- [Overview](#overview)
- [How to test the app for a11y users?](#how-to-test-the-app-for-a11y-users)
- [Setting up Accessibility Scanner and Talkback](#setting-up-accessibility-scanner-and-talkback)
- [Setup Play Store in mobile emulator](#setup-play-store-in-mobile-emulator)
- [Setup Play Store in tablet emulator](#setup-play-store-in-tablet-emulator)
- [Using a11y scanner in android](#using-a11y-scanner-in-android)
- [Using Talkback in android](#using-talkback-in-android)
- [Useful Resources](#useful-resources)
- [Using AccessibilityTestRule in Espresso Tests](#using-accessibilitytestrule-in-espresso-tests)
- [Auditing the app](#auditing-the-app)
- [General Tips to make app Accessible](#general-tips-to-make-app-accessible)
- [Exceptional Cases](#exceptional-cases)
- [Android 12 Warnings around TextViews in Fixed Layouts](#android-12-warnings-around-textviews-in-fixed-layouts)

## Overview
Accessibility is an important part of Oppia to ensure that the app is accessible by everyone. Some common conditions that affect a person's use of an Android device are:
* blindness / low vision
Expand Down
8 changes: 8 additions & 0 deletions wiki/Background-Processing.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Table of Contents

- [Overview](#overview)
- [Background](#background)
- [Definition of background processing & when to use it](#definition-of-background-processing--when-to-use-it)
- [Why we care](#why-we-care)
- [Background processing & concurrency in Oppia Android](#background-processing--concurrency-in-oppia-android)

## Overview

This page aims to provide some context around:
Expand Down
14 changes: 14 additions & 0 deletions wiki/Bazel-Setup-Instructions-for-Windows.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## Table of Contents

- [Overview & Disclaimer](#overview--disclaimer)
- [Instructions](#instructions)
- [1. Install Ubuntu subsystem](#1-install-ubuntu-subsystem)
- [2. Prerequisite debian packages](#2-prerequisite-debian-packages)
- [3. Installing the Android SDK](#3-installing-the-android-sdk)
- [4. Installing Bazel](#4-installing-bazel)
- [5. Preparing build environment for Oppia Android](#5-preparing-build-environment-for-oppia-android)
- [6. Verifying the build](#6-verifying-the-build)
- [7. Next steps](#7-next-steps)
- [Appendix](#appendix)
- [Limitations](#limitations)

## Overview & Disclaimer

This page outlines one way to allow Bazel to be used in CLI form on Windows. Please note that **this support is currently experimental**. You may run into some problems--we suggest that you [file an issue](https://github.com/oppia/oppia-android/issues/new/choose) ior contact us at [gitter](https://gitter.im/oppia/oppia-android).
Expand Down
6 changes: 6 additions & 0 deletions wiki/Buf-Guide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Table of Contents

- [Installation](#installation)
- [Commands](#commands)
- [Configuration File](#configuration-file)

# Installation
Once you had completed all the [installation steps](https://github.com/oppia/oppia-android/wiki#prerequisites), you will be having a `buf` file in your `opensource/oppia-android-tools` folder.<br>
**Note: Currently, Buf is not available for windows.**
Expand Down
10 changes: 10 additions & 0 deletions wiki/Coding-style-guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
Please follow the following style rules when writing code, in order to minimize unnecessary back-and-forth during code review.

## Table of Contents

- [General](#general)
- [Code Formatting](#code-formatting)
- [Comments](#comments)
- [XML files](#xml-files)
- [Java/Kotlin files](#javakotlin-files)
- [Layout files](#layout-files)
- [build.gradle file](#buildgradle-file)

## General
- We follow the [Kotlin Android style guide](https://developer.android.com/kotlin/style-guide).
- Use 2 spaces for indentation and 4 spaces for continuation, per https://google.github.io/styleguide/javaguide.html#s4.2-block-indentation. (This should be configured at the project level for Kotlin. Ensure that you're using the project configuration for Kotlin in your IDE, so that you can reformat the code via the IDE if needed.)
Expand Down
5 changes: 5 additions & 0 deletions wiki/Contributing-to-Oppia-Android.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ If you run into any problems along the way, we're here to help! Check out our [w

## Table of Contents

- [How to find information on this wiki](#how-to-find-information-on-this-wiki)
- [Onboarding instructions](#onboarding-instructions)
- [Guidance on submitting a PR](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR)
- [Developing your skills](https://github.com/oppia/oppia-android/wiki/Developing-skills)
- [Important: Ongoing Bazel migration](#important-ongoing-bazel-migration)
- [Installing the Oppia web app](#installing-the-oppia-web-app)
- [Communication channels](#communication-channels)

## How to find information on this wiki

<img width="1074" alt="Screenshot wiki preview" src="https://user-images.githubusercontent.com/76530270/235522765-3d17617e-1f3b-4531-b84c-33af94885863.gif">

## Onboarding instructions

If you'd like to help out with the Android project, please follow the following steps to get started:
Expand Down
6 changes: 6 additions & 0 deletions wiki/Creating-a-screenshot.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
There are three ways in which we can easily take screenshots and get it on the computer

## Table of Contents

- [Using Android Studio on an Emulator](#using-android-studio-on-an-emulator)
- [Using Android Studio on a local device](#using-android-studio-on-a-local-device)
- [Using an ADB command](#using-an-adb-command)

## Using Android Studio on an Emulator
If you are running Oppia on an emulator running on Android Studio, you can directly take a screenshot from the sidebar of the emulator.
<p align="center">
Expand Down
11 changes: 11 additions & 0 deletions wiki/Dagger.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## Table of Contents

- [What is Dagger?](#what-is-dagger)
- [Components & Subcomponents](#components--subcomponents)
- [Scopes](#scopes)
- [Injectables & Providers](#injectables--providers)
- [Modules](#modules)
- [Its Usage in Oppia Android](#its-usage-in-oppia-android)
- [How to write Tests with Dagger](#how-to-write-tests-with-dagger)
- [Points to Note](#points-to-note)

# What is Dagger?
Dagger is a fully static and compile-time [dependency injection](https://github.com/oppia/oppia-android/wiki/Dependency-Injection) framework. Compile-time means that issues in the dependency graph (such as cycles or missing providers) are caught during build-time.

Expand Down
8 changes: 8 additions & 0 deletions wiki/Dark-Mode.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
_Author credit: Thanks to **@ayush0402** for writing up the initial version of this guide._

## Table of Contents

- [Overview](#overview)
- [Knowing the convention](#knowing-the-convention)
- [Working with the layouts](#working-with-the-layouts)
- [How to achieve this goal?](#how-to-achieve-this-goal)
- [Running the app with dark mode](#running-the-app-with-dark-mode)

## Overview
This guide explains the newly adopted convention for using colors in oppia-android and adding support for dark mode
to any particular layout while keeping the code organised and strictly following the decided convention.
Expand Down
9 changes: 9 additions & 0 deletions wiki/DataProvider-&-LiveData.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Table of Contents

- [DataProviders](#dataproviders)
- [Transferring data to UI via LiveData](#transferring-data-to-ui-via-livedata)
- [Best practices/antipractices](#best-practicesantipractices)
- [DataProvider simplifications](#dataprovider-simplifications)
- [DataProviders utility](#dataproviders-utility)
- [LiveData transformations](#livedata-transformations)

### DataProviders

[DataProvider](https://github.com/oppia/oppia-android/blob/a85399c2b0a2b9cf214881ce8c70d9b487f1e0b8/utility/src/main/java/org/oppia/android/util/data/DataProvider.kt#L10)s are gateways to safely receiving an asynchronous result from an operation. They support notifications for when the DataProvider has new data to be retrieved, force usage of suspend functions to encourage coroutine use, have utilities for simplifying their usage, and provide an easy way to pass data to the UI via LiveData.
Expand Down
5 changes: 5 additions & 0 deletions wiki/Dependency-Injection.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Table of Contents

- [What is Dependency Injection?](#what-is-dependency-injection)
- [Why do we need it?](#why-do-we-need-it)

# What is Dependency Injection?
- It's a mechanism to automatically provide dependencies that an object depends on
- It requires the object receiving dependencies to also be injectable for other dependencies
Expand Down
10 changes: 10 additions & 0 deletions wiki/End-to-End-Testing-Guide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## Table of Contents

- [Overview](#overview)
- [How it works.](#how-it-works)
- [How to run an End-to-End test](#how-to-run-an-end-to-end-test)
- [Prerequisites](#prerequisites)
- [Steps to run the tests](#steps-to-run-the-tests)
- [Best practices when writing End-to-End tests](#best-practices-when-writing-end-to-end-tests)
- [Writing E2E tests](#writing-e2e-tests)

## Overview

End-to-End tests test the app from an end user’s experience by simulating the real user scenario and validating the system under test and its components for integration and data integrity.
Expand Down
6 changes: 6 additions & 0 deletions wiki/Fork-and-Clone-Oppia-Android.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

_For a detailed explanation of the fork-and-clone process, please see this [GitHub help page](https://help.github.com/en/github/getting-started-with-github/fork-a-repo#platform-linux)._

## Table of Contents

- [Fork and clone the Oppia Android repository](#fork-and-clone-the-oppia-android-repository)
- [Using the terminal](#using-the-terminal)
- [Using android studio's UI based GitHub workflow](#using-android-studios-ui-based-github-workflow)

## Fork and clone the Oppia Android repository

To make code changes, please follow the following instructions
Expand Down
9 changes: 9 additions & 0 deletions wiki/Frequent-Errors-and-Solutions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Table of Contents

- [Dagger Unresolved reference](#dagger-unresolved-reference)
- [Crashing layout tags in tablet](#crashing-layout-tags-in-tablet)
- [Push failed](#push-failed)
- [Facing error while debugging code](#facing-error-while-debugging-code)
- [Benefits](#benefits)
- [How to Write a Debugging Doc](#how-to-write-a-debugging-doc)

## Dagger Unresolved reference
**Error**: Unresolved reference `DaggerXXTest_TestApplicationComponent`

Expand Down
14 changes: 14 additions & 0 deletions wiki/Guidance-on-submitting-a-PR.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ Here are the steps for making a PR to the Oppia Android codebase:

Note: If your change involves more than around 500 lines of code, we recommend first creating a [design doc](https://github.com/oppia/oppia/wiki/Writing-design-docs). This helps avoid duplication of effort, and allows us to offer advice and suggestions on the implementation approach.

## Table of Contents

- [Step 1: Making a local code change](#step-1-making-a-local-code-change)
- [Making a local code change using the terminal](#making-a-local-code-change-using-the-terminal)
- [Making a local code change using Android Studio's UI-based Github workflow](#making-a-local-code-change-using-android-studios-ui-based-github-workflow)
- [Step 2: Create a PR on GitHub](#step-2-create-a-pr-on-github)
- [Important Points to Keep in Mind](#important-points-to-keep-in-mind)
- [Clarification regarding **Assignees** and **Reviewers** section.](#clarification-regarding-assignees-and-reviewers-section)
- [Step 3: Address review comments until all reviewers give LGTM](#step-3-address-review-comments-until-all-reviewers-give-lgtm)
- [Tips for getting your PR submitted](#tips-for-getting-your-pr-submitted)
- [Appendix: Resolving merge conflicts using the terminal](#appendix-resolving-merge-conflicts-using-the-terminal)
- [Appendix: Resolving merge conflicts using Android Studio](#appendix-resolving-merge-conflicts-using-android-studio)
- [Step 4: Tidy up and celebrate!](#step-4-tidy-up-and-celebrate-confetti_ball)

## Step 1: Making a local code change

Before you make a PR, you'll need to make and test the changes locally. To do this, please follow the following instructions carefully! Otherwise, your code review may be delayed.
Expand Down
9 changes: 9 additions & 0 deletions wiki/Internationalization.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
We are grateful for the support of [Translatewiki](https://translatewiki.net/w/i.php?title=Special:Translate&group=oppia-android-app&filter=%21translated&action=translate) in contributing internationalized platform strings for the Oppia Android app! (Note that Translatewiki only provides support for translations of platform UI strings; content string translations are handled via the Contributor Dashboard on the Oppia.org website.)

## Table of Contents

- [Helping out with translations](#helping-out-with-translations)
- [Minimal set of topics](#minimal-set-of-topics)
- [Policy for enabling new languages](#policy-for-enabling-new-languages)
- [Procedure for enabling new languages](#procedure-for-enabling-new-languages)
- [To enable a new language in Translatewiki](#to-enable-a-new-language-in-translatewiki)
- [To enable a new language in the Android app](#to-enable-a-new-language-in-the-android-app)

## Helping out with translations

If you would like to help out with translations, you can do so by visiting the [Translatewiki dashboard](https://translatewiki.net/w/i.php?title=Special:Translate&group=oppia-android-app&filter=%21translated&action=translate) and picking a supported language from the dropdown menu on the right.
Expand Down
8 changes: 8 additions & 0 deletions wiki/Ktlint-Guide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Table of Contents

- [Installation](#installation)
- [Commands](#commands)
- [Macros](#macros)
- [Steps to create a macro](#steps-to-create-a-macro)
- [How to fix the most common issues?](#how-to-fix-the-most-common-issues)

# Installation
Once you had completed all the [installation steps](https://github.com/oppia/oppia-android/wiki#prerequisites), you will be having a `ktlint` file in your `opensource/oppia-android-tools` folder.

Expand Down
22 changes: 22 additions & 0 deletions wiki/Oppia-Android-Testing.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## Table of Contents

- [Overview](#overview)
- [Learning how to write good tests](#learning-how-to-write-good-tests)
- [Guidelines for testing](#guidelines-for-testing)
- [Naming Convention](#naming-convention)
- [assertThat() vs. assertEqual(), assertTrue() / assertFalse()](#assertthat-vs-assertequal-asserttrue--assertfalse)
- [Testing private methods/functions](#testing-private-methodsfunctions)
- [Oppia project organization for tests](#oppia-project-organization-for-tests)
- [Robolectric](#robolectric)
- [Running Robolectric tests](#running-robolectric-tests)
- [Espresso](#espresso)
- [How to use View Matchers, View Actions and View Assertions in Espresso?](#how-to-use-view-matchers-view-actions-and-view-assertions-in-espresso)
- [Using isCompletelyDisplayed and isDisplayed](#using-iscompletelydisplayed-and-isdisplayed)
- [Using swipeLeft/Right and using scrollToPage](#using-swipeleftright-and-using-scrolltopage)
- [Testing RecyclerViews at Specific Positions](#testing-recyclerviews-at-specific-positions)
- [RecyclerViewActions](#recyclerviewactions)
- [RecyclerViewMatcher](#recyclerviewmatcher)
- [Tips to run test cases in both Espresso and Robolectric](#tips-to-run-test-cases-in-both-espresso-and-robolectric)
- [Performance Exception/Runtime Exception Failure](#performance-exceptionruntime-exception-failure)
- [Assertion Failure](#assertion-failure)

# Overview
Testing the app is an integral part of an app development process. By running tests against the app consistently, you can verify your app's correctness, functional behavior, and usability before you release it publicly.

Expand Down
11 changes: 11 additions & 0 deletions wiki/Oppia-Bazel-Setup-Instructions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## Table of Contents

- [Overview](#overview)
- [Installation](#installation)
- [Building the app](#building-the-app)
- [Building + installing the app](#building--installing-the-app)
- [Running specific module (app) Robolectric tests](#running-specific-module-app-robolectric-tests)
- [Running all Robolectric tests (slow)](#running-all-robolectric-tests-slow)
- [Known Issues and Troubleshooting](#known-issues-and-troubleshooting)
- [Concepts and Terminology](#concepts-and-terminology)

## Overview
Bazel is an open-source build and test tool similar to Make, Maven, and Gradle. It uses a human-readable, high-level build language.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
The Oppia Android codebase makes use of Kotlin and XML and can be built using Android Studio. The Oppia app follows a layered architecture that combines parts of [MVP](https://medium.com/upday-devs/android-architecture-patterns-part-2-model-view-presenter-8a6faaae14a5) (Model-View-Presenter), [MVC](https://medium.com/@joespinelli_6190/mvc-model-view-controller-ef878e2fd6f5) (Model-View-Controller), and [MVVM](https://medium.com/upday-devs/android-architecture-patterns-part-3-model-view-viewmodel-e7eeee76b73b) (Model-View-ViewModel).

## Table of Contents

- [Directory Structure](#directory-structure)
- [App Architecture](#app-architecture)
- [Codebase Walkthrough](#codebase-walkthrough)
- [Example 1](#example-1)
- [Example 2](#example-2)
- [Dependency Injection](#dependency-injection)

## Directory Structure

<img width="750" alt="Screenshot 2020-01-13 at 1 21 25 PM" src="https://user-images.githubusercontent.com/9396084/72245148-e60c4b80-3615-11ea-8a28-73b2b2bfc656.png">
Expand Down
6 changes: 6 additions & 0 deletions wiki/PersistentCacheStore-&-In-Memory-Blocking-Cache.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Table of Contents

- [PersistentCacheStore](#persistentcachestore)
- [In-Memory blocking cache](#in-memory-blocking-cache)
- [Other cases of background processing](#other-cases-of-background-processing)

### PersistentCacheStore

[``PersistentCacheStore``](https://github.com/oppia/oppia-android/blob/a85399c2b0a2b9cf214881ce8c70d9b487f1e0b8/data/src/main/java/org/oppia/android/data/persistence/PersistentCacheStore.kt#L34) is the team's replacement to ``SharedPreferences`` except it:
Expand Down
9 changes: 9 additions & 0 deletions wiki/Platform-Parameters-&-Feature-Flags.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Table of Contents

- [Introduction](#introduction)
- [How to create a Platform Parameter](#how-to-create-a-platform-parameter)
- [How to consume a Platform Parameter](#how-to-consume-a-platform-parameter)
- [How to write tests related Platform Parameter](#how-to-write-tests-related-platform-parameter)
- [1. We actually don't test for platform parameter(s)](#1-we-actually-dont-test-for-platform-parameters)
- [2. We test for different values of platform parameter(s)](#2-we-test-for-different-values-of-platform-parameters)

## Introduction
With a large scale system like Oppia, we sometimes have features that contain several points of integration in the codebase, and/or require additional data priming or migrations ahead of the feature being released. These features often span multiple releases and thus require feature flags to gate integration points to ensure that the feature is not partially released ahead of schedule. Moreover, these features often require migrations which need to be run in specific releases due to new versions being made in irreversible data structures (e.g. explorations).

Expand Down
7 changes: 7 additions & 0 deletions wiki/RTL-Guidelines.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Table of Contents

- [What is RTL?](#what-is-rtl)
- [What changes in RTL?](#what-changes-in-rtl)
- [Testing app for RTL Layouts](#testing-app-for-rtl-layouts)
- [Reference Documentation](#reference-documentation)

# What is RTL?
The main difference between left-to-right (LTR) and right-to-left (RTL) language scripts is the direction in which content is displayed:

Expand Down
6 changes: 6 additions & 0 deletions wiki/Revert-&-regression-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ When you find yourself in a situation where something seems newly broken in the

If you get stuck along the way, please mention in the issue that you filed in (1) that you are unable to locate commit introducing the regression.

## Table of Contents

- [Why do we revert PRs rather than just fix them?](#why-do-we-revert-prs-rather-than-just-fix-them)
- [How to find the offending commit](#how-to-find-the-offending-commit)
- [What do I do if I caused a regression?](#what-do-i-do-if-i-caused-a-regression)

## Why do we revert PRs rather than just fix them?

Leaving problems checked in can result in the following two situations:
Expand Down
12 changes: 12 additions & 0 deletions wiki/Spotlight-Guide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
Feature Spotlights

## Table of Contents

- [Introduction](#introduction)
- [Creating a new spotlight](#creating-a-new-spotlight)
- [Registering a new feature](#registering-a-new-feature)
- [Hooking up the spotlight](#hooking-up-the-spotlight)
- [Testing spotlights](#testing-spotlights)
- [Disabling the spotlights](#disabling-the-spotlights)
- [In tests](#in-tests)
- [In production](#in-production)

# Introduction

Spotlight is a visual tool that highlights and brings a user’s focus to an element on the screen. We use them to communicate the purpose of a specific screen element to the user, which they might otherwise miss. Spotlighting involves dimming the other areas on the screen and lighting the element to bring the user’s focus onto it, and explaining what/how that feature should be used. For example, this is a spotlight on the home screen spotlighting a story:
Expand Down
Loading